fix: skip npm i for examples without package.json

This commit is contained in:
weboko 2022-12-07 19:07:57 +01:00 committed by weboko
parent efd431914f
commit 440e297c60
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ function createApp(name, template) {
}
function runNpmInApp(root) {
const packageJsonPath = path.resolve(root, "package.json");
if (!fs.existsSync(packageJsonPath)) {
return;
}
console.log("Installing npm packages.");
try {
execSync(`npm install --prefix ${root}`, { stdio: "ignore" });