Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.16.0 to 7.16.3. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.16.3/eslint/babel-eslint-parser) --- updated-dependencies: - dependency-name: "@babel/eslint-parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
41 lines
1.3 KiB
JavaScript
Executable File
41 lines
1.3 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
// [start-readme]
|
|
//
|
|
// This script copies any English files that are missing from the translations directory into the translations directory.
|
|
// We only need to run this if problems occur with Crowdin's automatic sync.
|
|
//
|
|
// [end-readme]
|
|
|
|
import { fileURLToPath } from 'url'
|
|
import path from 'path'
|
|
import fs from 'fs'
|
|
import walk from 'walk-sync'
|
|
import mkdirp from 'mkdirp'
|
|
import languages from '../lib/languages.js'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
const dirs = ['content', 'data']
|
|
|
|
for (const dir of dirs) {
|
|
const englishPath = path.join(__dirname, `../${dir}`)
|
|
const filenames = walk(englishPath).filter((filename) => {
|
|
return (
|
|
(filename.endsWith('.yml') || filename.endsWith('.md')) && !filename.endsWith('README.md')
|
|
)
|
|
})
|
|
|
|
for (const filename of filenames) {
|
|
for (const language of Object.values(languages)) {
|
|
if (language.code === 'en') continue
|
|
const fullPath = path.join(__dirname, '..', language.dir, dir, filename)
|
|
if (!fs.existsSync(fullPath)) {
|
|
console.log('missing', fullPath)
|
|
const englishFullPath = path.join(__dirname, '..', dir, filename)
|
|
await mkdirp(path.dirname(fullPath))
|
|
fs.writeFileSync(fullPath, fs.readFileSync(englishFullPath))
|
|
}
|
|
}
|
|
}
|
|
}
|