1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/script/remove-extraneous-translation-files.js
Kevin Heis 8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00

25 lines
736 B
JavaScript
Executable File

#!/usr/bin/env node
import fs from 'fs'
import findExtraneousFiles from './helpers/find-extraneous-translation-files.js'
// [start-readme]
//
// An [automated test](/tests/extraneous-translation-files.js) checks for files in the `translations/` directory
// that do not have an equivalent English file in the `content/` directory, and fails if it finds extraneous files.
// When the test fails, a human needs to run this script to remove the files.
//
// [end-readme]
main()
async function main() {
const files = findExtraneousFiles()
console.log(
`Found ${files.length} extraneous translation ${files.length === 1 ? 'file' : 'files'}\n\n`
)
files.forEach((file) => {
console.log(file)
fs.unlinkSync(file)
})
}