0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

refactor(cli): use tryThat() to enforce exit (#4267)

This commit is contained in:
Gao Sun 2023-07-31 14:53:23 +08:00 committed by GitHub
parent fde330a8b3
commit 2aeb575ccd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@ import { readFileSync, existsSync } from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import { trySafe } from '@silverhand/essentials';
import { tryThat } from '@silverhand/essentials';
import ts from 'typescript';
import { consoleLog } from '../../../utils.js';
@ -312,7 +312,7 @@ export const syncPhraseKeysAndFileStructure = async (
consoleLog.warn(`Cannot find ${targetLocale} entrypoint, creating one`);
}
await trySafe(
await tryThat(
traverseNode(baseline, targetObject, path.join(targetDirectory, 'index.ts'), true),
(error) => {
consoleLog.plain();