mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Replace spawn shell option with explicit shell args to avoid DEP0190 warning
This commit is contained in:
parent
0681c71894
commit
a8ccd7b6fb
5 changed files with 27 additions and 16 deletions
|
|
@ -12,6 +12,7 @@ import type { HistoryItem } from '../ui/types.js';
|
|||
import { MessageType } from '../ui/types.js';
|
||||
import { spawnWrapper } from './spawnWrapper.js';
|
||||
import type { spawn } from 'node:child_process';
|
||||
import os from 'node:os';
|
||||
|
||||
export function handleAutoUpdate(
|
||||
info: UpdateObject | null,
|
||||
|
|
@ -53,7 +54,10 @@ export function handleAutoUpdate(
|
|||
'@latest',
|
||||
isNightly ? '@nightly' : `@${info.update.latest}`,
|
||||
);
|
||||
const updateProcess = spawnFn(updateCommand, { stdio: 'pipe', shell: true });
|
||||
const isWindows = os.platform() === 'win32';
|
||||
const shell = isWindows ? 'cmd.exe' : 'bash';
|
||||
const shellArgs = isWindows ? ['/c', updateCommand] : ['-c', updateCommand];
|
||||
const updateProcess = spawnFn(shell, shellArgs, { stdio: 'pipe' });
|
||||
let errorOutput = '';
|
||||
updateProcess.stderr.on('data', (data) => {
|
||||
errorOutput += data.toString();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue