build: update cli (#3374)

This commit is contained in:
Alex Yang
2023-07-25 14:32:18 -07:00
committed by GitHub
parent f968587f6f
commit 521e505a01
3 changed files with 36 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import { resolve } from 'node:path';
import { runCli } from '@magic-works/i18n-codegen';
import { projectRoot } from '../config/index.js';
const configPath = resolve(projectRoot, '.i18n-codegen.json');
export const watchI18N = () => {
runCli(
{
config: configPath,
watch: true,
},
error => {
console.error(error);
}
);
};
export const buildI18N = () => {
runCli(
{
config: configPath,
watch: false,
},
error => {
console.error(error);
process.exit(1);
}
);
};