mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 22:17:14 +00:00
fix(update): suppress Node deprecation warnings on Windows
This commit is contained in:
@@ -236,8 +236,13 @@ async function performNpmUpdate(
|
|||||||
|
|
||||||
const performUpdate = (): void => {
|
const performUpdate = (): void => {
|
||||||
// On Windows, use shell with full command string to avoid deprecation warning
|
// On Windows, use shell with full command string to avoid deprecation warning
|
||||||
|
// Also suppress Node deprecation warnings that may come from package managers
|
||||||
const child = isWindows
|
const child = isWindows
|
||||||
? spawn(`${updateCommand} ${updateArgs.join(' ')}`, [], { stdio: 'inherit', shell: true })
|
? spawn(`${updateCommand} ${updateArgs.join(' ')}`, [], {
|
||||||
|
stdio: 'inherit',
|
||||||
|
shell: true,
|
||||||
|
env: { ...process.env, NODE_NO_WARNINGS: '1' },
|
||||||
|
})
|
||||||
: spawn(updateCommand, updateArgs, { stdio: 'inherit' });
|
: spawn(updateCommand, updateArgs, { stdio: 'inherit' });
|
||||||
|
|
||||||
child.on('exit', (code) => {
|
child.on('exit', (code) => {
|
||||||
@@ -273,7 +278,11 @@ async function performNpmUpdate(
|
|||||||
console.log(info('Clearing package cache...'));
|
console.log(info('Clearing package cache...'));
|
||||||
// On Windows, use shell with full command string to avoid deprecation warning
|
// On Windows, use shell with full command string to avoid deprecation warning
|
||||||
const cacheChild = isWindows
|
const cacheChild = isWindows
|
||||||
? spawn(`${cacheCommand} ${cacheArgs.join(' ')}`, [], { stdio: 'inherit', shell: true })
|
? spawn(`${cacheCommand} ${cacheArgs.join(' ')}`, [], {
|
||||||
|
stdio: 'inherit',
|
||||||
|
shell: true,
|
||||||
|
env: { ...process.env, NODE_NO_WARNINGS: '1' },
|
||||||
|
})
|
||||||
: spawn(cacheCommand, cacheArgs, { stdio: 'inherit' });
|
: spawn(cacheCommand, cacheArgs, { stdio: 'inherit' });
|
||||||
|
|
||||||
cacheChild.on('exit', (code) => {
|
cacheChild.on('exit', (code) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user