@hi18n/cli
Version:
Message internationalization meets immutability and type-safety - command line tool
37 lines • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hi18n = hi18n;
const commander_1 = require("commander");
const export_ts_1 = require("./export.js");
const sync_ts_1 = require("./sync.js");
async function hi18n(argv, cwd = process.cwd(), output, overrideExit) {
const program = new commander_1.Command();
program.name("hi18n").description("CLI for managing translations with hi18n");
if (output)
program.configureOutput(output);
if (overrideExit)
program.exitOverride();
program
.command("sync")
.description("Synchronize translation ids")
.argument("[files...]")
.option("--exclude <files...>")
.option("-c, --check", "report errors if one or more files would be changed")
.action(syncCommand);
program.command("export").description("export data").action(exportCommand);
async function syncCommand(files, options) {
await (0, sync_ts_1.sync)({
cwd,
include: files,
exclude: options.exclude,
checkOnly: options.check,
});
}
async function exportCommand() {
await (0, export_ts_1.export_)({
cwd,
});
}
await program.parseAsync(argv);
}
//# sourceMappingURL=command.js.map