Merge pull request #7 from emdash-cms/fix/create-emdash-spinner

fix(create-emdash): fix spinner hanging during dep install
This commit is contained in:
Matt Kane authored and GitHub committed 2026-04-01 14:24:28 +01:00
commit 0c6c66fe44
2 files changed
+10 -5

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"create-emdash": patch
---
Fix spinner hanging during dependency installation by using async exec instead of execSync, which was blocking the event loop and preventing the spinner animation from updating.
+5 -5
View File
@@ -6,9 +6,12 @@
* Usage: npm create emdash@latest
*/
import { execSync } from "node:child_process";
import { exec } from "node:child_process";
import { existsSync, readFileSync, writeFileSync } from "node:fs";
import { resolve } from "node:path";
import { promisify } from "node:util";
const execAsync = promisify(exec);
import * as p from "@clack/prompts";
import { downloadTemplate } from "giget";
@@ -251,10 +254,7 @@ async function main() {
if (shouldInstall) {
s.start(`Installing dependencies with ${pc.cyan(pm)}...`);
try {
execSync(installCmd, {
cwd: projectDir,
stdio: "ignore",
});
await execAsync(installCmd, { cwd: projectDir });
s.stop("Dependencies installed!");
} catch {
s.stop("Failed to install dependencies");