Skip to content

Commit 551cf46

Browse files
use extension id as key not folder name which is more accurate (microsoft#153178)
1 parent ba9b33b commit 551cf46

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

build/azure-pipelines/upload-nlsmetadata.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const vfs = require("vinyl-fs");
99
const merge = require("gulp-merge-json");
1010
const gzip = require("gulp-gzip");
1111
const identity_1 = require("@azure/identity");
12+
const path = require("path");
13+
const fs_1 = require("fs");
1214
const azure = require('gulp-azure-storage');
1315
const commit = process.env['VSCODE_DISTRO_COMMIT'] || process.env['BUILD_SOURCEVERSION'];
1416
const credential = new identity_1.ClientSecretCredential(process.env['AZURE_TENANT_ID'], process.env['AZURE_CLIENT_ID'], process.env['AZURE_CLIENT_SECRET']);
@@ -62,7 +64,11 @@ function main() {
6264
break;
6365
}
6466
}
65-
const key = 'vscode.' + file.relative.split('/')[0];
67+
// Get extension id and use that as the key
68+
const folderPath = path.join(file.base, file.relative.split('/')[0]);
69+
const manifest = (0, fs_1.readFileSync)(path.join(folderPath, 'package.json'), 'utf-8');
70+
const manifestJson = JSON.parse(manifest);
71+
const key = manifestJson.publisher + '.' + manifestJson.name;
6672
return { [key]: parsedJson };
6773
},
6874
}))

build/azure-pipelines/upload-nlsmetadata.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as vfs from 'vinyl-fs';
99
import * as merge from 'gulp-merge-json';
1010
import * as gzip from 'gulp-gzip';
1111
import { ClientSecretCredential } from '@azure/identity';
12+
import path = require('path');
13+
import { readFileSync } from 'fs';
1214
const azure = require('gulp-azure-storage');
1315

1416
const commit = process.env['VSCODE_DISTRO_COMMIT'] || process.env['BUILD_SOURCEVERSION'];
@@ -79,7 +81,12 @@ function main(): Promise<void> {
7981
break;
8082
}
8183
}
82-
const key = 'vscode.' + file.relative.split('/')[0];
84+
85+
// Get extension id and use that as the key
86+
const folderPath = path.join(file.base, file.relative.split('/')[0]);
87+
const manifest = readFileSync(path.join(folderPath, 'package.json'), 'utf-8');
88+
const manifestJson = JSON.parse(manifest);
89+
const key = manifestJson.publisher + '.' + manifestJson.name;
8390
return { [key]: parsedJson };
8491
},
8592
}))

0 commit comments

Comments
 (0)