refactor(tts): replace execa shell command with native fs.rm iteration

This commit is contained in:
mitchell 2026-06-09 21:27:08 -04:00
parent 32f9dd5495
commit 4674cca337

5
tts.ts
View file

@ -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");