diff --git a/src/services/melo-tts.ts b/src/services/melo-tts.ts index ccf7daf..3ef04bd 100644 --- a/src/services/melo-tts.ts +++ b/src/services/melo-tts.ts @@ -12,9 +12,16 @@ async function run(command: string, args: string[], stdio: "ignore" | "inherit" const child = spawn(command, args, { stdio: ["ignore", stdio, "inherit"], windowsHide: true, + shell: process.platform === "win32", }); - child.on("error", reject); + child.on("error", (error) => { + if ((error as NodeJS.ErrnoException).code === "ENOENT" && command === "docker") { + reject(new Error("Docker를 찾지 못했습니다. Docker Desktop을 설치하고 실행한 뒤 다시 시도하세요.")); + return; + } + reject(error); + }); child.on("exit", (code) => { if (code === 0) { resolve(); diff --git a/src/setup-tts.ts b/src/setup-tts.ts index 526ec08..58ddae2 100644 --- a/src/setup-tts.ts +++ b/src/setup-tts.ts @@ -13,9 +13,16 @@ async function run(command: string, args: string[], cwd = process.cwd()): Promis cwd, stdio: "inherit", windowsHide: true, + shell: process.platform === "win32", }); - child.on("error", reject); + child.on("error", (error) => { + if ((error as NodeJS.ErrnoException).code === "ENOENT" && command === "docker") { + reject(new Error("Docker를 찾지 못했습니다. Docker Desktop을 설치하고 실행한 뒤 다시 시도하세요.")); + return; + } + reject(error); + }); child.on("exit", (code) => { if (code === 0) { resolve();