From d3ecc4d91ab67e3b2c487d1ad15a56eeadf4658f Mon Sep 17 00:00:00 2001 From: Carsten Klein Date: Sat, 6 Oct 2018 17:49:34 +0200 Subject: [PATCH] fix gh-176: fail early if there is no tmp dir specified --- lib/tmp.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tmp.js b/lib/tmp.js index 5859d74..d2a8cf7 100644 --- a/lib/tmp.js +++ b/lib/tmp.js @@ -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);