Skip to content

Commit cc6c4a2

Browse files
committed
try installing the extension another way
1 parent 60d9199 commit cc6c4a2

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

.github/workflows/job-compile-and-test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ jobs:
4545
run: yarn test
4646
working-directory: Extension
4747

48-
- name: Install latest cpptools
49-
run: code --install-extension ms-vscode.cpptools --pre-release
50-
5148
- name: Acquire Native Binaries
52-
run: yarn run copy-extension-binaries
49+
run: yarn install-and-copy-binaries-for-test
5350
working-directory: Extension
5451

5552
- name: Run languageServer integration tests

Extension/.scripts/copyExtensionBinaries.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,15 @@ async function getInstalledExtensions(root: string): Promise<InstalledExtension[
7474
}
7575

7676
async function findLatestInstalledExtension(providedPath?: string): Promise<string> {
77-
if (providedPath) {
78-
return providedPath;
79-
}
80-
8177
const searchRoots: string[] = [
8278
join(homedir(), '.vscode', 'extensions'),
8379
join(homedir(), '.vscode-insiders', 'extensions'),
8480
join(homedir(), '.vscode-server', 'extensions'),
8581
join(homedir(), '.vscode-server-insiders', 'extensions')
8682
];
83+
if (providedPath) {
84+
searchRoots.unshift(join(providedPath, 'extensions'));
85+
}
8786

8887
const installed: InstalledExtension[] = (await Promise.all(searchRoots.map(each => getInstalledExtensions(each)))).flat();
8988
if (!installed.length) {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* --------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All Rights Reserved.
3+
* See 'LICENSE' in the project root for license information.
4+
* ------------------------------------------------------------------------------------------ */
5+
6+
import { spawnSync } from 'child_process';
7+
import { verbose } from '../src/Utility/Text/streams';
8+
import { heading } from './common';
9+
import * as copy from './copyExtensionBinaries';
10+
import { install, isolated } from "./vscode";
11+
12+
export async function main() {
13+
console.log(heading(`Install VS Code`));
14+
const { cli, args } = await install();
15+
16+
console.log(heading('Install latest C/C++ Extension'));
17+
verbose(`Running command: ${cli} ${args.join(' ')} --install-extension ms-vscode.cpptools --pre-release`);
18+
const result = spawnSync(cli, ['--install-extension', 'ms-vscode.cpptools', '--pre-release'], { encoding: 'utf-8', shell: true })
19+
if (result.stdout) {
20+
verbose(result.stdout.toString());
21+
}
22+
23+
await copy.main(isolated);
24+
}

Extension/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6806,6 +6806,7 @@
68066806
"generate-options-schema": "ts-node -T ./.scripts/generateOptionsSchema.ts",
68076807
"copy-walkthrough-media": "ts-node -T ./.scripts/copyWalkthruMedia.ts",
68086808
"copy-extension-binaries": "ts-node -T ./.scripts/copyExtensionBinaries.ts",
6809+
"install-and-copy-binaries-for-test": "ts-node -T ./.scripts/installAndCopyBinaries.ts",
68096810
"translations-export": "yarn install && yarn prep && yarn generate-native-strings && gulp translations-export",
68106811
"translations-generate": "gulp translations-generate",
68116812
"translations-import": "gulp translations-import",

0 commit comments

Comments
 (0)