Skip to content

Commit

Permalink
fix gh-176: fail early if there is no tmp dir specified
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Mar 13, 2019
1 parent 0343c9e commit b0ad81a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/tmp.js
Expand Up @@ -121,6 +121,12 @@ function _parseArguments(options, callback) {
* @private
*/
function _generateTmpName(opts) {

// fail early on missing tmp dir
if (!opts.dir && !tmpDir) {
throw new Error('No tmp dir specified');
}

/* istanbul ignore else */
if (opts.name) {
return path.join(opts.dir || tmpDir, opts.name);
Expand Down

0 comments on commit b0ad81a

Please sign in to comment.