Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/doodle-node-cli / src / prompts / i18n-prompt.js
Size: Mime:
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;