refactor(tts): replace execa shell command with native fs.rm iteration
This commit is contained in:
parent
32f9dd5495
commit
4674cca337
1 changed files with 3 additions and 2 deletions
5
tts.ts
5
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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue