From 2aeb575ccdc47ec0374dd190bba1a3f87fd272d5 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Mon, 31 Jul 2023 14:53:23 +0800 Subject: [PATCH] refactor(cli): use `tryThat()` to enforce exit (#4267) --- packages/cli/src/commands/translate/sync-keys/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/translate/sync-keys/utils.ts b/packages/cli/src/commands/translate/sync-keys/utils.ts index 126e32c73..706e673cf 100644 --- a/packages/cli/src/commands/translate/sync-keys/utils.ts +++ b/packages/cli/src/commands/translate/sync-keys/utils.ts @@ -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();