1
0
mirror of synced 2025-12-20 02:19:14 -05:00
Files
docs/script/remove-extraneous-translation-files.js
Kevin Heis b29e37318a Remove import x statements (#20594)
* Clear out most import x

* Update rimraf use

* Move up readme blocks in scripts
2021-07-29 20:28:30 +00:00

26 lines
737 B
JavaScript
Executable File

#!/usr/bin/env node
// [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]
import fs from 'fs'
import findExtraneousFiles from './helpers/find-extraneous-translation-files.js'
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)
})
}