fix(vscode-ide-companion): improve cross-platform compatibility in prepackage script

- Enable shell option conditionally for Windows platform
- Use 'node' command directly and template literals for path handling
This commit is contained in:
yiliang114
2025-12-14 00:00:06 +08:00
parent b6128ef2d2
commit 9280739a85

View File

@@ -35,7 +35,7 @@ function npmBin() {
function run(cmd, args, opts = {}) {
const res = spawnSync(cmd, args, {
stdio: 'inherit',
shell: false,
shell: process.platform === 'win32' ? true : false,
...opts,
});
if (res.error) {
@@ -71,8 +71,8 @@ function main() {
console.log('[prepackage] Copying bundled CLI dist/ into extension...');
run(
process.execPath,
[path.join(extensionRoot, 'scripts', 'copy-bundled-cli.js')],
'node',
[`${path.join(extensionRoot, 'scripts', 'copy-bundled-cli.js')}`],
{
cwd: extensionRoot,
},