Resolve Docker path for VSCode terminals

This commit is contained in:
2026-05-03 17:22:52 +09:00
parent c328ef517e
commit aa14ebc447
6 changed files with 108 additions and 4 deletions

View File

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