From 0f0837f5ca4b2938aa316b91cb7aacb6446e4fe8 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 21 Mar 2023 18:47:43 +0800 Subject: [PATCH] fix(cli): dts pipe (#1532) --- cli/src/build.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/cli/src/build.ts b/cli/src/build.ts index d5b78a59..bbff6286 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -646,14 +646,28 @@ export class BuildCommand extends Command { jsBindingFilePath, idents, ) - if (this.pipe && jsBindingFilePath) { - const pipeCommand = `${this.pipe} ${jsBindingFilePath}` + if (this.pipe) { + if (jsBindingFilePath) { + const pipeCommand = `${this.pipe} ${jsBindingFilePath}` + console.info(`Run ${chalk.green(pipeCommand)}`) + try { + execSync(pipeCommand, { stdio: 'inherit', env: commandEnv }) + } catch (e) { + console.warn( + chalk.bgYellowBright( + 'Pipe the js binding file to command failed', + ), + e, + ) + } + } + const pipeCommand = `${this.pipe} ${dtsFilePath}` console.info(`Run ${chalk.green(pipeCommand)}`) try { execSync(pipeCommand, { stdio: 'inherit', env: commandEnv }) } catch (e) { console.warn( - chalk.bgYellowBright('Pipe the js binding file to command failed'), + chalk.bgYellowBright('Pipe the dts file to command failed'), e, ) }