Update grammars to pick up make changes
and fix hashes.
This commit is contained in:
parent
13e506e5d5
commit
b0b6dc6c2e
|
@ -12,6 +12,8 @@ var cson = require('cson-parser');
|
|||
var https = require('https');
|
||||
var url = require('url');
|
||||
|
||||
let commitDate = '0000-00-00';
|
||||
|
||||
/**
|
||||
* @param {string} urlString
|
||||
*/
|
||||
|
@ -120,30 +122,35 @@ 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;
|
||||
const currentCommitDate = info.commitDate.substr(0, 10);
|
||||
|
||||
// Add commit sha to cgmanifest.
|
||||
if (currentCommitDate > commitDate) {
|
||||
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;
|
||||
commitDate = currentCommitDate;
|
||||
promises.push(download(packageJsonPath).then(function (packageJson) {
|
||||
if (packageJson) {
|
||||
try {
|
||||
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
|
||||
} catch (e) {
|
||||
console.log('Cannot get version. 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) + ')');
|
||||
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + currentCommitDate + ')');
|
||||
} else {
|
||||
console.log('Updated ' + path.basename(dest));
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
"git": {
|
||||
"name": "atom/language-c",
|
||||
"repositoryUrl": "https://github.com/atom/language-c",
|
||||
"commitHash": "3a269f88b12e512fb9495dc006a1dabf325d3d7f"
|
||||
"commitHash": "9c0c5f202741a5647025db8d5df5fefba47b036c"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "0.58.0",
|
||||
"version": "0.58.1",
|
||||
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
|
||||
},
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"git": {
|
||||
"name": "textmate/git.tmbundle",
|
||||
"repositoryUrl": "https://github.com/textmate/git.tmbundle",
|
||||
"commitHash": "93897a78c6e52bef13dadc0d4091d203c5facb40"
|
||||
"commitHash": "3f6ad2138200db14b57a090ecb2d2e733275ca3e"
|
||||
}
|
||||
},
|
||||
"licenseDetail": [
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"git": {
|
||||
"name": "textmate/html.tmbundle",
|
||||
"repositoryUrl": "https://github.com/textmate/html.tmbundle",
|
||||
"commitHash": "390c8870273a2ae80244dae6db6ba064a802f407"
|
||||
"commitHash": "0c3d5ee54de3a993f747f54186b73a4d2d3c44a2"
|
||||
}
|
||||
},
|
||||
"licenseDetail": [
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"git": {
|
||||
"name": "fadeevab/make.tmbundle",
|
||||
"repositoryUrl": "https://github.com/fadeevab/make.tmbundle",
|
||||
"commitHash": "d01ce3404f9e2eed0fd4d07b5e24094c03599241"
|
||||
"commitHash": "21e9108e9dce13b798667806bb105d852ac0a58c"
|
||||
}
|
||||
},
|
||||
"licenseDetail": [
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/fadeevab/make.tmbundle/commit/d01ce3404f9e2eed0fd4d07b5e24094c03599241",
|
||||
"version": "https://github.com/fadeevab/make.tmbundle/commit/21e9108e9dce13b798667806bb105d852ac0a58c",
|
||||
"name": "Makefile",
|
||||
"scopeName": "source.makefile",
|
||||
"patterns": [
|
||||
|
@ -342,7 +342,12 @@
|
|||
"begin": "(^[ ]*|\\G\\s*)([^\\s]+)\\s*((?<![?:+!])=|\\?=|:=|\\+=|!=)",
|
||||
"beginCaptures": {
|
||||
"2": {
|
||||
"name": "variable.other.makefile"
|
||||
"name": "variable.other.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variables"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.key-value.makefile"
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
"git": {
|
||||
"name": "language-php",
|
||||
"repositoryUrl": "https://github.com/atom/language-php",
|
||||
"commitHash": "b6c5e83016b52311cdc622c2579462861ee91587"
|
||||
"commitHash": "b896ebfb6f669b8714f419527f047466420efe5c"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "0.44.0"
|
||||
"version": "0.44.1"
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"git": {
|
||||
"name": "atom/language-sass",
|
||||
"repositoryUrl": "https://github.com/atom/language-sass",
|
||||
"commitHash": "804a935ea1d50504e14a7f602e2bb133fee8450c"
|
||||
"commitHash": "303bbf0c250fe380b9e57375598cfd916110758b"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"git": {
|
||||
"name": "Microsoft/vscode-mssql",
|
||||
"repositoryUrl": "https://github.com/Microsoft/vscode-mssql",
|
||||
"commitHash": "3aa44d04b04d219ad5fa8f411ca9dd32294a7a06"
|
||||
"commitHash": "cd754662e5607c62ecdc51d2a2dc844546a0bbb6"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue