From 1ae154daf58202474281c63736afe1fe842250d1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 11 Aug 2022 11:03:33 +0100 Subject: [PATCH] Install after retrieving skeleton for custom plugins. --- packages/cli/src/exec.js | 3 ++- packages/cli/src/plugins/index.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/exec.js b/packages/cli/src/exec.js index 07520336c4..8b1134c897 100644 --- a/packages/cli/src/exec.js +++ b/packages/cli/src/exec.js @@ -21,5 +21,6 @@ exports.runPkgCommand = async command => { if (!yarn && !npm) { throw new Error("Must have yarn or npm installed to run build.") } - await exports.exec(yarn ? `yarn ${command}` : `npm run ${command}`) + const npmCmd = command === "install" ? `npm ${command}` : `npm run ${command}` + await exports.exec(yarn ? `yarn ${command}` : npmCmd) } diff --git a/packages/cli/src/plugins/index.js b/packages/cli/src/plugins/index.js index 6ec99ac7fa..6ce2d47e63 100644 --- a/packages/cli/src/plugins/index.js +++ b/packages/cli/src/plugins/index.js @@ -33,8 +33,11 @@ async function init(opts) { ) const version = await questions.string("Version", "1.0.0") // get the skeleton + console.log(info("Retrieving project...")) await getSkeleton(type, name) await fleshOutSkeleton(name, desc, version) + console.log(info("Installing dependencies...")) + await runPkgCommand("install") console.log(info(`Plugin created in directory "${name}"`)) }