Skip to content

Commit 4b522ef

Browse files
authored
Merge pull request #3769 from github/koesie10/improve-sourcemap-script
Improve source map script
2 parents b1be37c + 426db0f commit 4b522ef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

extensions/ql-vscode/scripts/source-map.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ async function extractSourceMap() {
4141
const releaseAssetsDirectory = resolve(
4242
__dirname,
4343
"..",
44+
"artifacts",
4445
"release-assets",
4546
versionNumber,
4647
);
@@ -64,7 +65,9 @@ async function extractSourceMap() {
6465
]);
6566

6667
const sourcemapAsset = release.assets.find(
67-
(asset) => asset.name === `vscode-codeql-sourcemaps-${versionNumber}.zip`,
68+
(asset) =>
69+
asset.label === `vscode-codeql-sourcemaps-${versionNumber}.zip` ||
70+
asset.name === "vscode-codeql-sourcemaps.zip",
6871
);
6972

7073
if (sourcemapAsset) {
@@ -213,9 +216,7 @@ extractSourceMap().catch((e: unknown) => {
213216
function runGh(args: readonly string[]): string {
214217
const gh = spawnSync("gh", args);
215218
if (gh.status !== 0) {
216-
throw new Error(
217-
`Failed to get the source map for ${versionNumber}: ${gh.stderr}`,
218-
);
219+
throw new Error(`Failed to run gh ${args.join(" ")}: ${gh.stderr}`);
219220
}
220221
return gh.stdout.toString("utf-8");
221222
}
@@ -227,6 +228,7 @@ function runGhJSON<T>(args: readonly string[]): T {
227228
type ReleaseAsset = {
228229
id: string;
229230
name: string;
231+
label: string;
230232
};
231233

232234
type Release = {

0 commit comments

Comments
 (0)