Skip to content

Commit

Permalink
Fixed bug in tempdirSync() call.
Browse files Browse the repository at this point in the history
  • Loading branch information
alinex committed Jan 26, 2015
1 parent 77fc36f commit c093207
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tempdir.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ debug = require('debug')('fs:tempdir')
fs = require 'fs'
path = require 'path'
crypto = require 'crypto'
os = require 'os'
# include other extended commands and helper


Expand Down Expand Up @@ -49,7 +50,8 @@ tempdir = module.exports.sync = (base, prefix = '') ->
# try to create dir
dir = path.join base, prefix + crypto.randomBytes(4).readUInt32LE(0)
try
return fs.mkdirSync dir
fs.mkdirSync dir
return dir
catch err
# try again if already existing
return tempdir base, prefix if err.code is 'EEXIST'
Expand Down

0 comments on commit c093207

Please sign in to comment.