Resolve Docker path for VSCode terminals
This commit is contained in:
@@ -4,6 +4,7 @@ import { mkdir, rm } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
import type { AppConfig } from "../config.js";
|
||||
import { resolveDockerCommand } from "../docker-runtime.js";
|
||||
import type { Logger } from "../logger.js";
|
||||
import { playWavFile } from "./audio-playback.js";
|
||||
|
||||
@@ -41,9 +42,10 @@ export class MeloTtsService {
|
||||
async warmup(): Promise<void> {
|
||||
await mkdir(path.resolve(process.cwd(), this.config.TTS_CACHE_DIR), { recursive: true });
|
||||
await mkdir(path.resolve(process.cwd(), this.config.TTS_OUTPUT_DIR), { recursive: true });
|
||||
const docker = await resolveDockerCommand(this.config);
|
||||
|
||||
await run("docker", ["--version"]);
|
||||
await run("docker", ["image", "inspect", this.config.TTS_IMAGE]);
|
||||
await run(docker, ["--version"]);
|
||||
await run(docker, ["image", "inspect", this.config.TTS_IMAGE]);
|
||||
}
|
||||
|
||||
async speak(text: string): Promise<void> {
|
||||
@@ -115,6 +117,7 @@ export class MeloTtsService {
|
||||
device: this.config.TTS_DEVICE,
|
||||
});
|
||||
|
||||
await run("docker", args, "inherit");
|
||||
const docker = await resolveDockerCommand(this.config);
|
||||
await run(docker, args, "inherit");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user