🐛 Bug fixes in launching

This commit is contained in:
LittleSheep 2025-01-12 15:06:30 +08:00
parent f12a4bc9c1
commit a719ac8aeb

View File

@ -103,13 +103,15 @@ export function launchApp(id: string): void {
const platform = process.platform
const runner = app.release.runners[platform]
const segments = runner.script.split(' ')
const segments = runner.script.split(' ').map(decodeURIComponent)
try {
spawn(segments[0], segments.length > 1 ? segments.slice(1) : [], {
const child = spawn(segments[0], segments.length > 1 ? segments.slice(1) : [], {
detached: true,
cwd: runner.workdir ? join(app.basePath, runner.workdir) : app.basePath,
})
child.stdout.pipe(process.stdout)
child.stderr.pipe(process.stderr)
} catch (err: any) {
console.error(err)
}