1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/script/remove-extraneous-translation-files.js
Vanessa Yuen 3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00

24 lines
732 B
JavaScript
Executable File

#!/usr/bin/env node
const fs = require('fs')
const findExtraneousFiles = require('../lib/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)
})
}