mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -120,6 +120,28 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas
|
||||
|
||||
try {
|
||||
fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n'));
|
||||
// Add commit sha to cgmanifest
|
||||
let cgmanifestRead = JSON.parse(fs.readFileSync('./cgmanifest.json').toString());
|
||||
let promises = new Array();
|
||||
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
|
||||
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
|
||||
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
|
||||
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
|
||||
promises.push(download(packageJsonPath).then(function (packageJson) {
|
||||
if (packageJson) {
|
||||
try {
|
||||
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
|
||||
} catch (e) {
|
||||
console.log('File does not exist at' + packageJsonPath);
|
||||
}
|
||||
}
|
||||
}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Promise.all(promises).then(function (allResult) {
|
||||
fs.writeFileSync('./cgmanifest.json', JSON.stringify(cgmanifestRead, null, '\t').replace(/\n/g, '\r\n'));
|
||||
});
|
||||
if (info) {
|
||||
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user