yargs / y18n

:ledger: the bare-bones i18n library used by yargs
ISC License
146 stars 48 forks source link

Generated empty locales file after `yargs` got an error. #48

Closed gucong3000 closed 7 years ago

gucong3000 commented 7 years ago

We use yargs and y18n: https://github.com/jedmao/eclint/blob/master/lib/cli.ts#L202

When yargs throw a error by demandCommand(1, 1, i18n('CommandError: Missing required sub-command.'))

yargs will kill main process. and y18n not finsh file write.

After executed this steps, any commands dump parse errors.

/usr/local/lib/node_modules/eclint/node_modules/y18n/index.js:79
    else throw err
         ^

SyntaxError: syntax error in /usr/local/lib/node_modules/eclint/locales/ja_JP.json
    at JSON.parse (<anonymous>)
gucong3000 commented 7 years ago

Any plan? This issue attaches importance to reproduction, interfering with CI operation

bcoe commented 7 years ago

@gucong3000 hey 👋 sorry for the slow reply; I see you might have found the solution and have a patch open on y18n? I will work on getting this landed for you ASAP.