Skip to content

Commit f7dacb7

Browse files
authored
Merge pull request #227 from Exlint/EXL-179
fix: 🐞 fix VSCode spawn path in darwin
2 parents 19577d0 + ad921b1 commit f7dacb7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/modules/use/helpers/vscode.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export const installExtensions = async (libraries: string[]) => {
8383
throw new Error('Failed to get VSCode path');
8484
}
8585

86+
vsCodeCliCommandPath = './code';
87+
8688
cwd = path.join(
8789
path.resolve(vsCodeFolderOutput.stdout.trim()),
8890
'Contents',
@@ -100,18 +102,24 @@ export const installExtensions = async (libraries: string[]) => {
100102
}
101103

102104
await new Promise<void>((resolve, reject) => {
105+
let output = '';
106+
103107
const spawner = spawn(vsCodeCliCommandPath, [...extensionsCmdArgs, '--force'].flat(), {
104108
cwd,
105109
windowsHide: true,
106110
shell: true,
107111
});
108112

113+
spawner.stderr?.on('data', (data) => {
114+
output += data;
115+
});
116+
109117
spawner.on('close', (exitCode: number) => {
110118
if (exitCode === 0) {
111119
return resolve();
112120
}
113121

114-
reject();
122+
reject(output);
115123
});
116124
});
117125
};

0 commit comments

Comments
 (0)