From a01fa04c2955e0f00f3bc29aa3862c2440a23c8e Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 5 Mar 2020 22:27:44 -0600 Subject: [PATCH] fix: run mkdir with recursive option to prevent exceptions Fixes #662 --- packages/agoric-cli/lib/init.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/agoric-cli/lib/init.js b/packages/agoric-cli/lib/init.js index ea8f2f7ca4d..1d6807fc61a 100644 --- a/packages/agoric-cli/lib/init.js +++ b/packages/agoric-cli/lib/init.js @@ -71,7 +71,7 @@ export default async function initMain(progname, rawArgs, priv, opts) { if (st.isDirectory()) { if (!target) { console.log(`mkdir ${destDir}${stem}`); - await mkdir(`${destDir}${stem}`); + await mkdir(`${destDir}${stem}`, { recursive: true }); } await recursiveTemplate(templateDir, destDir, `${stem}`); } else if (st.isSymbolicLink()) { @@ -88,7 +88,7 @@ export default async function initMain(progname, rawArgs, priv, opts) { ); }; await recursiveTemplate(dappRoot); - await mkdir(`${DIR}/_agstate`); + await mkdir(`${DIR}/_agstate`, { recursive: true }); const ps = ['', 'api/', 'contract/', 'ui/'].map(dir => { const path = `${DIR}/${dir}package.json`;