Merge branch 'INDA-330-pii-update' into 'main'
[ProtonMail-WebClient.git] / packages / i18n / index.js
blob891793e37bfe1bc9e76e8ef6a546cae1ee8536da
1 #!/usr/bin/env node
3 const { error } = require('./lib/helpers/log')('proton-i18n');
4 const renderHelp = require('./lib/helpers/help');
6 const argv = process.argv.slice(2);
7 const is = (command) => argv.includes(command);
9 async function main() {
10 const [, ...options] = argv;
12 if (is('extract')) {
13 await require('./lib/extract')(options[0]);
16 if (is('validate')) {
17 const flags = { isVerbose: options.includes('--verbose') };
18 const args = options.filter((val) => !val.startsWith('--'));
19 await require('./lib/validate')(options[0], { dir: args[1], flags });
22 if (is('help')) {
23 renderHelp();
25 process.exit(0);
28 main().catch(error);