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 Oct 6, 2018
1 parent fcbf27b commit d3ecc4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/tmp.js
Expand Up @@ -121,6 +121,11 @@ 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 d3ecc4d

Please sign in to comment.