From 64919f107b3a53ac6675a979047b86a2d43b1d54 Mon Sep 17 00:00:00 2001 From: zkz098 Date: Fri, 5 Jul 2024 22:11:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20toolbox=20=E7=BC=BA=E5=B0=91=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolbox/compiler.mjs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/toolbox/compiler.mjs b/toolbox/compiler.mjs index 49f2916..8eeffdb 100644 --- a/toolbox/compiler.mjs +++ b/toolbox/compiler.mjs @@ -46,12 +46,16 @@ if (CONFIG.legacyScript) { } else if (sPath.startsWith('file:\\')) { sPath = sPath.slice(8); // 去除 'file:\' } - child_process.exec('pnpm --package=typescript dlx tsc --build'.trim(), { - cwd: sPath - }, async (code, stdout, stderr) => { - console.log('Deleting typescript files...') - await deleteFileRecursive(sPath) - console.log('Finished compiling.') + child_process.exec('pnpm install',{ + cwd: path.join(sPath,'./../') + }, (code, stdout, stderr) => { + child_process.exec('pnpm --package=typescript dlx tsc --build'.trim(), { + cwd: sPath + }, async (code, stdout, stderr) => { + console.log('Deleting typescript files...') + await deleteFileRecursive(sPath) + console.log('Finished compiling.') + }) }) } else { throw Error('Not implemented yet.')