Skip to content

Commit d610683

Browse files
authored
Merge pull request #7152 from Elias-Graf/fix_get_unix_arch_env
Add missing env to `GetUnixArchitecture`
2 parents f764e78 + 9424615 commit d610683

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export function safeLength<T>(arr: T[] | undefined) {
5858

5959
export async function execChildProcess(
6060
command: string,
61-
workingDirectory: string = getExtensionPath(),
62-
env: NodeJS.ProcessEnv = {}
61+
workingDirectory: string,
62+
env: NodeJS.ProcessEnv
6363
): Promise<string> {
6464
return new Promise<string>((resolve, reject) => {
6565
cp.exec(command, { cwd: workingDirectory, maxBuffer: 500 * 1024, env: env }, (error, stdout, stderr) => {

src/shared/platform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class PlatformInformation {
173173
}
174174

175175
private static async GetUnixArchitecture(): Promise<string> {
176-
const architecture = (await util.execChildProcess('uname -m', __dirname)).trim();
176+
const architecture = (await util.execChildProcess('uname -m', __dirname, process.env)).trim();
177177
if (architecture === 'aarch64') {
178178
return 'arm64';
179179
}
@@ -183,7 +183,7 @@ export class PlatformInformation {
183183
// Emulates https://github.com/dotnet/install-scripts/blob/3c6cc06/src/dotnet-install.sh#L187-L189.
184184
private static async GetIsMusl(): Promise<boolean> {
185185
try {
186-
const output = await util.execChildProcess('ldd --version', __dirname);
186+
const output = await util.execChildProcess('ldd --version', __dirname, process.env);
187187
return output.includes('musl');
188188
} catch (err) {
189189
return err instanceof Error ? err.message.includes('musl') : false;

test/vscodeLauncher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function main() {
6969
}
7070

7171
const dotnetPath = path.join(process.env.DOTNET_ROOT, 'dotnet');
72-
await execChildProcess(`${dotnetPath} build ${sln}`, workspacePath);
72+
await execChildProcess(`${dotnetPath} build ${sln}`, workspacePath, process.env);
7373
}
7474

7575
// Download VS Code, unzip it and run the integration test

0 commit comments

Comments
 (0)