From 25030b7f4f59b789a95fe2241ddb12f1c41f69fb Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 22 Mar 2024 14:05:04 +0800 Subject: [PATCH] action --- script/sync-localize.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/sync-localize.ts b/script/sync-localize.ts index 735c056..da7bfc1 100644 --- a/script/sync-localize.ts +++ b/script/sync-localize.ts @@ -1,4 +1,4 @@ -import { ScriptFunction, completePromise } from '@code-recycle/cli'; +import type { ScriptFunction } from '@code-recycle/cli'; let fn: ScriptFunction = async (util, rule, host, injector) => { let data = await rule.os.gitClone( 'https://github.com/angular/angular.git', @@ -20,7 +20,11 @@ let fn: ScriptFunction = async (util, rule, host, injector) => { if (key.endsWith('bazel') || key.includes('/test')) { continue; } - await completePromise(host.write(util.path.join(util.path.normalize('./localize'), key), fileObj[key])); + await new Promise((res) => { + host.write(util.path.join(util.path.normalize('./localize'), key), fileObj[key]).subscribe({ + complete: () => res(undefined), + }); + }); } let list = await util.changeList([ {