diff --git a/tts.ts b/tts.ts index 907a05c..844166b 100644 --- a/tts.ts +++ b/tts.ts @@ -1,3 +1,4 @@ +#!/usr/bin/env node import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; @@ -63,8 +64,8 @@ async function main() { const home = os.homedir(); const cwd = path.join(home, ".ttsc"); - const wavs = await Array.fromAsync(fs.glob(path.join(cwd, "*.wav"))); - await execa({ cwd, shell: true, reject: false })`rm ${wavs}`; + const wavs = fs.glob(path.join(cwd, "*.wav")); + for await (const wav of wavs) await fs.rm(wav); if (edit) { const file = path.join(cwd, "input.txt");