From b40d2f2a29b4703fbac187eec975d589eaf4ae30 Mon Sep 17 00:00:00 2001 From: Akeem McLennon Date: Thu, 1 Jun 2017 11:53:52 -0500 Subject: [PATCH] Create parent directories for tape files --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 6a1fdea..344b6c3 100644 --- a/index.js +++ b/index.js @@ -32,6 +32,8 @@ module.exports = function (host, opts) { return buffer(req).then(function (body) { var file = path.join(opts.dirname, tapename(req, body)); + mkdirp.sync(path.dirname(file)); + return Promise.try(function () { return require.resolve(file); }).catch(ModuleNotFoundError, function (/* err */) {