Skip to content

Commit

Permalink
fix(cli): dts pipe (#1532)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Mar 21, 2023
1 parent 3d48d44 commit 0f0837f
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions cli/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
Expand Down

0 comments on commit 0f0837f

Please sign in to comment.