Skip to content

Commit a872fa2

Browse files
committed
issues in release.js on windows, update attrs. doc
1 parent 8f80dcd commit a872fa2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

release.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fs = require('fs');
2+
const os = require('os');
23
const child_process = require('child_process');
34

45
let prog = '??';
@@ -42,7 +43,8 @@ function isPreRelease() {
4243
}
4344

4445
function vsceRun(pkgOnly) {
45-
const args = ['npx', 'vsce', (pkgOnly ? 'package' : 'publish')];
46+
const npx = 'npx';
47+
const args = [npx, 'vsce', (pkgOnly ? 'package' : 'publish')];
4648
if (isPreRelease()) {
4749
args.push('--pre-release');
4850
if (vsxAlso) {
@@ -69,7 +71,7 @@ function vsceRun(pkgOnly) {
6971
}
7072
});
7173
if (vsxAlso) {
72-
const vsxCmd = ['npx', 'ovsx', 'publish', '-p', openVsxPat];
74+
const vsxCmd = [npx, 'ovsx', 'publish', '-p', openVsxPat];
7375
runProg(vsxCmd, (code) => {
7476
if (code !== 0) {
7577
errExit(`Failed '${vsxCmd}'`);
@@ -84,9 +86,12 @@ function runProg(args, cb) {
8486
if (isDryRun) {
8587
args.unshift('echo');
8688
}
87-
// console.log('Executing ' + args.join(' '));
8889
const cmd = args.join(' ');
89-
const arg0 = args.shift();
90+
const arg0 = os.platform() === 'win32' ? 'cmd.exe' : args.shift();
91+
if (os.platform() === 'win32') {
92+
args.unshift('/c');
93+
}
94+
// console.log('Executing ' + arg0 + ' ' + args.join(' '));
9095
const prog = child_process.spawn(arg0, args, {
9196
stdio: 'inherit'
9297
});

0 commit comments

Comments
 (0)