Skip to content

Commit 0f0bbca

Browse files
committed
fix: avoid shell: true deprecation warning on Node 24
the "shell" option is used to support executing npm on win32 (during "pleb publish"). ensure the args are part of the command to avoid a security warning about them not being automatically escaped.
1 parent 33da99e commit 0f0bbca

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/commands/publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function publish({
4949
stdio: 'inherit',
5050
shell: true,
5151
};
52-
spawnSyncLogged('npm', publishArgs, spawnOptions, npmPackage.displayName);
52+
spawnSyncLogged(`npm ${publishArgs.join(' ')}`, spawnOptions, npmPackage.displayName);
5353
log(`${npmPackage.displayName}: done.`);
5454
}
5555
} else {

src/utils/process.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ export const spawnSyncSafe = ((...args: Parameters<typeof spawnSync>) => {
1515

1616
export function spawnSyncLogged(
1717
command: string,
18-
args: string[],
1918
options: SpawnSyncOptions,
2019
label = options.cwd || process.cwd(),
2120
): SpawnSyncReturns<string | Buffer> {
22-
log(`${label.toString()}: ${command} ${args.join(' ')}`);
23-
return spawnSyncSafe(command, args, options);
21+
log(`${label.toString()}: ${command}`);
22+
return spawnSyncSafe(command, options);
2423
}
2524

2625
export function reportProcessError(message: unknown): void {

0 commit comments

Comments
 (0)