Skip to content

Commit

Permalink
Fix the bug that caused an error when setting the initial configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
qihangnet committed May 5, 2023
1 parent e1af9ae commit e0fcb0d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ import { KnownError } from './helpers/error';
import i18n from './helpers/i18n';

const init = async () => {
const { LANGUAGE: language } = await getConfig();
i18n.setLanguage(language);
try {
const { LANGUAGE: language } = await getConfig();
i18n.setLanguage(language);
} catch {
i18n.setLanguage('en');
}
};

let examples: string[] = [];
const examples: string[] = [];
init().then(() => {
examples.push(i18n.t('delete all log files'));
examples.push(i18n.t('list js files'));
Expand Down

0 comments on commit e0fcb0d

Please sign in to comment.