Moves DEFAULT_PREFENCES into JSON format.
This commit is contained in:
parent
c1c199d702
commit
df10513e10
9 changed files with 143 additions and 41 deletions
26
gulpfile.js
26
gulpfile.js
|
@ -72,6 +72,22 @@ function stripUMDHeaders(content) {
|
|||
return content.replace(reg, '');
|
||||
}
|
||||
|
||||
function checkChromePreferencesFile(chromePrefsPath, webPrefsPath) {
|
||||
var chromePrefs = JSON.parse(fs.readFileSync(chromePrefsPath).toString());
|
||||
var chromePrefsKeys = Object.keys(chromePrefs.properties);
|
||||
chromePrefsKeys.sort();
|
||||
var webPrefs = JSON.parse(fs.readFileSync(webPrefsPath).toString());
|
||||
var webPrefsKeys = Object.keys(webPrefs);
|
||||
webPrefsKeys.sort();
|
||||
if (webPrefsKeys.length !== chromePrefsKeys.length) {
|
||||
return false;
|
||||
}
|
||||
return webPrefsKeys.every(function (value, index) {
|
||||
return chromePrefsKeys[index] === value &&
|
||||
chromePrefs.properties[value].default === webPrefs[value];
|
||||
});
|
||||
}
|
||||
|
||||
function bundle(filename, outfilename, pathPrefix, initFiles, amdName, defines,
|
||||
isMainFile, versionInfo) {
|
||||
// Reading UMD headers and building loading orders of modules. The
|
||||
|
@ -489,6 +505,16 @@ gulp.task('lint', function (done) {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log();
|
||||
console.log('### Checking supplemental files');
|
||||
|
||||
if (!checkChromePreferencesFile(
|
||||
'extensions/chromium/preferences_schema.json',
|
||||
'web/default_preferences.json')) {
|
||||
done(new Error('chromium/preferences_schema is not in sync.'));
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('files checked, no errors found');
|
||||
done();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue