Skip to content

Commit

Permalink
fix(cli): disable js binding generation if no --platform flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 18, 2021
1 parent 45a7485 commit f577512
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/src/build.ts
Expand Up @@ -76,7 +76,7 @@ export class BuildCommand extends Command {
jsBinding = Option.String('--js', 'index.js', {
description: `Path to the JS binding file, pass ${chalk.underline(
chalk.yellow('false'),
)} to disable it`,
)} to disable it. Only affect if ${chalk.green('--target')} specified.`,
})

cargoCwd?: string = Option.String('--cargo-cwd', {
Expand Down Expand Up @@ -299,7 +299,9 @@ export class BuildCommand extends Command {
}
}
const jsBindingFilePath =
this.jsBinding && this.jsBinding !== 'false'
this.jsBinding &&
this.jsBinding !== 'false' &&
this.appendPlatformToFilename
? join(process.cwd(), this.jsBinding)
: null
await writeJsBinding(binaryName, packageName, jsBindingFilePath, idents)
Expand Down

0 comments on commit f577512

Please sign in to comment.