Fix Docker credential helper path for TTS
This commit is contained in:
@@ -9,12 +9,20 @@ import { Logger } from "./logger.js";
|
||||
import { MeloTtsService } from "./services/melo-tts.js";
|
||||
|
||||
async function run(command: string, args: string[], cwd = process.cwd()): Promise<void> {
|
||||
const env = { ...process.env };
|
||||
if (path.isAbsolute(command)) {
|
||||
const dockerBinDir = path.dirname(command);
|
||||
const currentPath = env.PATH ?? env.Path ?? "";
|
||||
env.PATH = `${dockerBinDir}${path.delimiter}${currentPath}`;
|
||||
}
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const child = spawn(command, args, {
|
||||
cwd,
|
||||
stdio: "inherit",
|
||||
windowsHide: true,
|
||||
shell: process.platform === "win32" && !path.isAbsolute(command),
|
||||
env,
|
||||
});
|
||||
|
||||
child.on("error", (error) => {
|
||||
|
||||
Reference in New Issue
Block a user