create-izi-noir 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Command } from "commander";
|
|
|
5
5
|
|
|
6
6
|
// src/commands/init.ts
|
|
7
7
|
import path2 from "path";
|
|
8
|
-
import { execSync } from "child_process";
|
|
8
|
+
import { execSync, spawn } from "child_process";
|
|
9
9
|
import pc3 from "picocolors";
|
|
10
10
|
|
|
11
11
|
// src/prompts/project.ts
|
|
@@ -2636,19 +2636,21 @@ Error: Directory "${projectOptions.projectName}" already exists and is not empty
|
|
|
2636
2636
|
}
|
|
2637
2637
|
}
|
|
2638
2638
|
if (!projectOptions.skipInstall) {
|
|
2639
|
-
process.stdout.write("\x1B[?25l");
|
|
2640
|
-
const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
2641
|
-
let i = 0;
|
|
2642
|
-
const startSpinner = setInterval(() => {
|
|
2643
|
-
process.stdout.write(`\r${pc3.cyan(frames[i++ % frames.length])} ${pc3.dim("Preparing npm install...")}`);
|
|
2644
|
-
}, 80);
|
|
2645
|
-
await new Promise((r) => setTimeout(r, 600));
|
|
2646
|
-
clearInterval(startSpinner);
|
|
2647
|
-
process.stdout.write("\r\x1B[K");
|
|
2648
2639
|
const installProgress = createInstallProgress();
|
|
2649
2640
|
installProgress.start();
|
|
2650
2641
|
try {
|
|
2651
|
-
|
|
2642
|
+
await new Promise((resolve, reject) => {
|
|
2643
|
+
const child = spawn("npm", ["install"], {
|
|
2644
|
+
cwd: projectDir,
|
|
2645
|
+
stdio: "ignore",
|
|
2646
|
+
shell: true
|
|
2647
|
+
});
|
|
2648
|
+
child.on("close", (code) => {
|
|
2649
|
+
if (code === 0) resolve();
|
|
2650
|
+
else reject(new Error(`npm install exited with code ${code}`));
|
|
2651
|
+
});
|
|
2652
|
+
child.on("error", reject);
|
|
2653
|
+
});
|
|
2652
2654
|
installProgress.stop(true);
|
|
2653
2655
|
} catch {
|
|
2654
2656
|
installProgress.stop(false);
|