Fix Docker credential helper path for TTS
This commit is contained in:
@@ -9,11 +9,19 @@ import type { Logger } from "../logger.js";
|
|||||||
import { playWavFile } from "./audio-playback.js";
|
import { playWavFile } from "./audio-playback.js";
|
||||||
|
|
||||||
async function run(command: string, args: string[], stdio: "ignore" | "inherit" = "ignore"): Promise<void> {
|
async function run(command: string, args: string[], stdio: "ignore" | "inherit" = "ignore"): 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) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
const child = spawn(command, args, {
|
const child = spawn(command, args, {
|
||||||
stdio: ["ignore", stdio, "inherit"],
|
stdio: ["ignore", stdio, "inherit"],
|
||||||
windowsHide: true,
|
windowsHide: true,
|
||||||
shell: process.platform === "win32" && !path.isAbsolute(command),
|
shell: process.platform === "win32" && !path.isAbsolute(command),
|
||||||
|
env,
|
||||||
});
|
});
|
||||||
|
|
||||||
child.on("error", (error) => {
|
child.on("error", (error) => {
|
||||||
|
|||||||
@@ -9,12 +9,20 @@ import { Logger } from "./logger.js";
|
|||||||
import { MeloTtsService } from "./services/melo-tts.js";
|
import { MeloTtsService } from "./services/melo-tts.js";
|
||||||
|
|
||||||
async function run(command: string, args: string[], cwd = process.cwd()): Promise<void> {
|
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) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
const child = spawn(command, args, {
|
const child = spawn(command, args, {
|
||||||
cwd,
|
cwd,
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
windowsHide: true,
|
windowsHide: true,
|
||||||
shell: process.platform === "win32" && !path.isAbsolute(command),
|
shell: process.platform === "win32" && !path.isAbsolute(command),
|
||||||
|
env,
|
||||||
});
|
});
|
||||||
|
|
||||||
child.on("error", (error) => {
|
child.on("error", (error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user