Skip to content

Commit b0b6dc6

Browse files
committed
Update grammars to pick up make changes
and fix hashes.
1 parent 13e506e commit b0b6dc6

10 files changed

Lines changed: 41 additions & 29 deletions

File tree

build/npm/update-grammar.js

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var cson = require('cson-parser');
1212
var https = require('https');
1313
var url = require('url');
1414

15+
let commitDate = '0000-00-00';
16+
1517
/**
1618
* @param {string} urlString
1719
*/
@@ -120,30 +122,35 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas
120122

121123
try {
122124
fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n'));
123-
// Add commit sha to cgmanifest
124125
let cgmanifestRead = JSON.parse(fs.readFileSync('./cgmanifest.json').toString());
125126
let promises = new Array();
126-
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
127-
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
128-
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
129-
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
130-
promises.push(download(packageJsonPath).then(function (packageJson) {
131-
if (packageJson) {
132-
try {
133-
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
134-
} catch (e) {
135-
console.log('File does not exist at' + packageJsonPath);
136-
}
137-
}
138-
}));
139-
break;
127+
const currentCommitDate = info.commitDate.substr(0, 10);
128+
129+
// Add commit sha to cgmanifest.
130+
if (currentCommitDate > commitDate) {
131+
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
132+
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
133+
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
134+
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
135+
commitDate = currentCommitDate;
136+
promises.push(download(packageJsonPath).then(function (packageJson) {
137+
if (packageJson) {
138+
try {
139+
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
140+
} catch (e) {
141+
console.log('Cannot get version. File does not exist at ' + packageJsonPath);
142+
}
143+
}
144+
}));
145+
break;
146+
}
140147
}
141148
}
142149
Promise.all(promises).then(function (allResult) {
143150
fs.writeFileSync('./cgmanifest.json', JSON.stringify(cgmanifestRead, null, '\t').replace(/\n/g, '\r\n'));
144151
});
145152
if (info) {
146-
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
153+
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + currentCommitDate + ')');
147154
} else {
148155
console.log('Updated ' + path.basename(dest));
149156
}

extensions/cpp/cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"git": {
77
"name": "atom/language-c",
88
"repositoryUrl": "https://github.com/atom/language-c",
9-
"commitHash": "3a269f88b12e512fb9495dc006a1dabf325d3d7f"
9+
"commitHash": "9c0c5f202741a5647025db8d5df5fefba47b036c"
1010
}
1111
},
1212
"license": "MIT",
13-
"version": "0.58.0",
13+
"version": "0.58.1",
1414
"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."
1515
},
1616
{

extensions/git/cgmanifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"git": {
77
"name": "textmate/git.tmbundle",
88
"repositoryUrl": "https://github.com/textmate/git.tmbundle",
9-
"commitHash": "93897a78c6e52bef13dadc0d4091d203c5facb40"
9+
"commitHash": "3f6ad2138200db14b57a090ecb2d2e733275ca3e"
1010
}
1111
},
1212
"licenseDetail": [

extensions/html/cgmanifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"git": {
77
"name": "textmate/html.tmbundle",
88
"repositoryUrl": "https://github.com/textmate/html.tmbundle",
9-
"commitHash": "390c8870273a2ae80244dae6db6ba064a802f407"
9+
"commitHash": "0c3d5ee54de3a993f747f54186b73a4d2d3c44a2"
1010
}
1111
},
1212
"licenseDetail": [

extensions/make/cgmanifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"git": {
77
"name": "fadeevab/make.tmbundle",
88
"repositoryUrl": "https://github.com/fadeevab/make.tmbundle",
9-
"commitHash": "d01ce3404f9e2eed0fd4d07b5e24094c03599241"
9+
"commitHash": "21e9108e9dce13b798667806bb105d852ac0a58c"
1010
}
1111
},
1212
"licenseDetail": [

extensions/make/syntaxes/make.tmLanguage.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
55
"Once accepted there, we are happy to receive an update request."
66
],
7-
"version": "https://github.com/fadeevab/make.tmbundle/commit/d01ce3404f9e2eed0fd4d07b5e24094c03599241",
7+
"version": "https://github.com/fadeevab/make.tmbundle/commit/21e9108e9dce13b798667806bb105d852ac0a58c",
88
"name": "Makefile",
99
"scopeName": "source.makefile",
1010
"patterns": [
@@ -342,7 +342,12 @@
342342
"begin": "(^[ ]*|\\G\\s*)([^\\s]+)\\s*((?<![?:+!])=|\\?=|:=|\\+=|!=)",
343343
"beginCaptures": {
344344
"2": {
345-
"name": "variable.other.makefile"
345+
"name": "variable.other.makefile",
346+
"patterns": [
347+
{
348+
"include": "#variables"
349+
}
350+
]
346351
},
347352
"3": {
348353
"name": "punctuation.separator.key-value.makefile"

extensions/php/cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"git": {
77
"name": "language-php",
88
"repositoryUrl": "https://github.com/atom/language-php",
9-
"commitHash": "b6c5e83016b52311cdc622c2579462861ee91587"
9+
"commitHash": "b896ebfb6f669b8714f419527f047466420efe5c"
1010
}
1111
},
1212
"license": "MIT",
13-
"version": "0.44.0"
13+
"version": "0.44.1"
1414
}
1515
],
1616
"version": 1

extensions/scss/cgmanifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"git": {
77
"name": "atom/language-sass",
88
"repositoryUrl": "https://github.com/atom/language-sass",
9-
"commitHash": "804a935ea1d50504e14a7f602e2bb133fee8450c"
9+
"commitHash": "303bbf0c250fe380b9e57375598cfd916110758b"
1010
}
1111
},
1212
"license": "MIT",

extensions/sql/cgmanifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"git": {
77
"name": "Microsoft/vscode-mssql",
88
"repositoryUrl": "https://github.com/Microsoft/vscode-mssql",
9-
"commitHash": "3aa44d04b04d219ad5fa8f411ca9dd32294a7a06"
9+
"commitHash": "cd754662e5607c62ecdc51d2a2dc844546a0bbb6"
1010
}
1111
},
1212
"license": "MIT",

extensions/sql/syntaxes/sql.tmLanguage.json

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)