UNPKG

react-lsm

Version:

A lightweight react hook for managing localization languages. LSM stands for Localization Storage Manager.

31 lines (28 loc) 950 B
#!/usr/bin/env ts-node "use strict"; var _generateEnum = require("./scripts/generateEnum"); // Get the arguments from the command line arguments /** * 1. @command ::fallback:: lsm-generate-enum * 2. @arg translationsPath * 3. @arg outputDir */ /** * @arg translationsPath * @required * @description The path to the translations file */ var translationsPath = process.argv[2]; /** * @arg outputDir * @optional * @description The path to the output directory * @default "src/react-lsm/enums" * @note If the directory does not exist, it will be created * @note It could be any of the translation objects you use, due to all the keys should be the same in all the translation objects */ var outputDir = process.argv[3]; console.log("Translations Path: ".concat(translationsPath)); console.log("Enum Name: TranslationKeysEnum"); console.log("Output Dir: ".concat(outputDir)); (0, _generateEnum.generateEnum)(translationsPath, outputDir);