Skip to content

Commit 8360285

Browse files
committed
1.0.5
1 parent 183b41d commit 8360285

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@idrinth/typescript-language-from-yaml",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "Translates yaml files to ts for translation autocompletion, autocorrection and better developer support",
55
"bin": {
66
"itlfy": "bin/itlfy.js"

src/cli.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
EXIT_FAILURE,
33
EXIT_SUCCESS,
44
FIRST_ARGUMENT,
5+
SECOND_ARGUMENT,
56
} from './constants.js';
67
import watch from './watch.js';
78
import generate from './generate.js';
@@ -12,12 +13,26 @@ export default async(args: string[], cwd: string,): Promise<number> => {
1213
const logger = new Logger();
1314
switch (args[FIRST_ARGUMENT]) {
1415
case 'check':
15-
return check(logger, cwd,) ? EXIT_SUCCESS : EXIT_FAILURE;
16+
return check(
17+
logger,
18+
args[SECOND_ARGUMENT] || cwd,
19+
) ? EXIT_SUCCESS : EXIT_FAILURE;
1620
case 'generate':
17-
generate(logger, cwd, args.includes('--split',), args.includes('--verbatimModuleSyntax',),);
21+
generate(
22+
logger,
23+
cwd,
24+
args.includes('--split',),
25+
args.includes('--verbatimModuleSyntax',),
26+
);
1827
return EXIT_SUCCESS;
1928
case 'watch':
20-
await watch(logger, cwd, args.splice(3,).map((arg,) => arg.split('=',),),);
29+
await watch(
30+
logger,
31+
cwd,
32+
args
33+
.splice(SECOND_ARGUMENT,)
34+
.map((arg,) => arg.split('=',),),
35+
);
2136
return EXIT_SUCCESS;
2237
default:
2338
logger.info('itlfy check - checks the current working directory\'s yaml files.',);

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ export const TARGET_DIR = 'src/locales';
44
export const EXIT_SUCCESS = 0;
55
export const EXIT_FAILURE = 1;
66
export const FIRST_ARGUMENT = 2;
7+
export const SECOND_ARGUMENT = 3;
78
export const EMPTY = 0;
89
export const DEFAULT_INDENTATION = 2;

0 commit comments

Comments
 (0)