Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

remove-extraneous-translation-files.js 735 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  1. #!/usr/bin/env node
  2. const fs = require('fs')
  3. const findExtraneousFiles = require('./helpers/find-extraneous-translation-files')
  4. // [start-readme]
  5. //
  6. // An [automated test](/tests/extraneous-translation-files.js) checks for files in the `translations/` directory
  7. // that do not have an equivalent English file in the `content/` directory, and fails if it finds extraneous files.
  8. // When the test fails, a human needs to run this script to remove the files.
  9. //
  10. // [end-readme]
  11. main()
  12. async function main () {
  13. const files = findExtraneousFiles()
  14. console.log(`Found ${files.length} extraneous translation ${files.length === 1 ? 'file' : 'files'}\n\n`)
  15. files.forEach(file => {
  16. console.log(file)
  17. fs.unlinkSync(file)
  18. })
  19. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...