Skip to content

Commit

Permalink
fix raszi#182 fileSync takes empty string postfix option
Browse files Browse the repository at this point in the history
  • Loading branch information
gutte committed Jan 10, 2019
1 parent fcbf27b commit 636e84b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tmp.js
Expand Up @@ -170,6 +170,7 @@ function tmpName(options, callback) {
return cb(new Error('Invalid template provided'));

(function _getUniqueName() {

const name = _generateTmpName(opts);

// check whether the path exists then retry if needed
Expand Down Expand Up @@ -285,7 +286,7 @@ function fileSync(options) {
args = _parseArguments(options),
opts = args[0];

opts.postfix = opts.postfix || '.tmp';
opts.postfix = (_isUndefined(opts.postfix)) ? '.tmp' : opts.postfix;

const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
const name = tmpNameSync(opts);
Expand Down

0 comments on commit 636e84b

Please sign in to comment.