Skip to content

Commit

Permalink
(f) don't use shelljs
Browse files Browse the repository at this point in the history
  • Loading branch information
per1234 committed Jul 26, 2023
1 parent 88cfa71 commit dea6893
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/i18n/transifex-pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const transifex = require('./transifex');
const path = require('path');
const fs = require('node:fs/promises');
const util = require('util');
const shell = require('shelljs');
const fetch = require('node-fetch');
Expand Down Expand Up @@ -108,7 +109,13 @@ const getTranslationDownloadStatus = async (language, downloadRequestId) => {
shell.echo('translations found:', languages.join(', '));

// Remove data managed on Transifex to avoid accumulation of vestigial files
shell.rm(path.join(translationsDirectory, '!(en).json'));
const translationFilenames = await fs.readdir(translationsDirectory);
for (const filename of translationFilenames) {
if (filename === 'en.json' || !filename.endsWith('.json')) {
continue;
}
await fs.unlink(path.join(translationsDirectory, filename));
}

let downloadIds = [];
for (const language of languages) {
Expand Down

0 comments on commit dea6893

Please sign in to comment.