Repository URL to install this package:
|
Version:
0.0.0-dbbf5e9efabe69 ▾
|
const inquirer = require('inquirer');
const chalk = require('chalk');
const { getAlli18nDataFromPath, discoverProblemsWithKeys, getPrettyPrintSummary } = require('../utils/i18n-checker');
async function i18nPrompt() {
await inquirer
.prompt([
{
type: 'input',
name: 'dirPath',
message: 'What is the absolute path to the onesky directory you want to check?',
},
{
type: 'list',
name: 'verbosity',
message: 'Print a minimal or verbose summary?',
choices: ['minimal', 'verbose'],
default: 'minimal',
},
])
.then(async answers => {
const { dirPath, verbosity } = answers;
console.log(`Searching for onesky files: ${chalk.gray(dirPath)}`);
const allI18nData = await getAlli18nDataFromPath(dirPath);
Object.keys(allI18nData).forEach(folder => {
console.log(
getPrettyPrintSummary(discoverProblemsWithKeys(allI18nData[folder], 'en', folder), verbosity === 'verbose')
);
});
});
}
module.exports = i18nPrompt;