1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/script/remove-extraneous-translation-files.js
Jason Etcovitch 8d4f3e65fe Move test & script utils out of /lib (#17517)
* Remove an unused file

* Move authenticate-to-aws to scripts/utils

* Move crowdin-config to tests/utils

* Remove add-frontmatter-to-file

* Move find-unused-assets

* Move git-utils to script/utils

* Move lib/github to script/utils

* Revert "Remove an unused file"

This reverts commit cd93ad846a0354e957359f23124eb0724c9147cf.

* Move find-extraneous-translation-files to script/utils

* We already have tests/helpers

* Rename script/utils => helpers for consistency

* Forgot a path

* Fix path to crowdin-config

Co-authored-by: Chiedo John <2156688+chiedo@users.noreply.github.com>
2021-01-29 10:30:51 -05:00

24 lines
735 B
JavaScript
Executable File

#!/usr/bin/env node
const fs = require('fs')
const findExtraneousFiles = require('./helpers/find-extraneous-translation-files')
// [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)
})
}