build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -1,18 +1,18 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const check = process.argv.includes('--check')
|
||||
const check = process.argv.includes('--check');
|
||||
|
||||
const dictsPath = path.resolve(__dirname, '..', '..', 'third_party', 'hunspell_dictionaries')
|
||||
const gclientPath = 'third_party/hunspell_dictionaries'
|
||||
const dictsPath = path.resolve(__dirname, '..', '..', 'third_party', 'hunspell_dictionaries');
|
||||
const gclientPath = 'third_party/hunspell_dictionaries';
|
||||
|
||||
const allFiles = fs.readdirSync(dictsPath)
|
||||
const allFiles = fs.readdirSync(dictsPath);
|
||||
|
||||
const dictionaries = allFiles
|
||||
.filter(file => path.extname(file) === '.bdic')
|
||||
.filter(file => path.extname(file) === '.bdic');
|
||||
|
||||
const licenses = allFiles
|
||||
.filter(file => file.startsWith('LICENSE') || file.startsWith('COPYING'))
|
||||
.filter(file => file.startsWith('LICENSE') || file.startsWith('COPYING'));
|
||||
|
||||
const content = `hunspell_dictionaries = [
|
||||
${dictionaries.map(f => `"//${path.posix.join(gclientPath, f)}"`).join(',\n ')},
|
||||
|
@ -21,15 +21,15 @@ const content = `hunspell_dictionaries = [
|
|||
hunspell_licenses = [
|
||||
${licenses.map(f => `"//${path.posix.join(gclientPath, f)}"`).join(',\n ')},
|
||||
]
|
||||
`
|
||||
`;
|
||||
|
||||
const filenamesPath = path.resolve(__dirname, '..', 'filenames.hunspell.gni')
|
||||
const filenamesPath = path.resolve(__dirname, '..', 'filenames.hunspell.gni');
|
||||
|
||||
if (check) {
|
||||
const currentContent = fs.readFileSync(filenamesPath, 'utf8')
|
||||
const currentContent = fs.readFileSync(filenamesPath, 'utf8');
|
||||
if (currentContent !== content) {
|
||||
throw new Error('hunspell filenames need to be regenerated, latest generation does not match current file. Please run node gen-hunspell-filenames.js')
|
||||
throw new Error('hunspell filenames need to be regenerated, latest generation does not match current file. Please run node gen-hunspell-filenames.js');
|
||||
}
|
||||
} else {
|
||||
fs.writeFileSync(filenamesPath, content)
|
||||
fs.writeFileSync(filenamesPath, content);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue