fix(cli): manifestPath and js binding output path (#1847)

This commit is contained in:
LongYinan 2023-12-08 13:56:17 +08:00 committed by GitHub
parent 3ecb11f35d
commit 1273735250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -556,6 +556,10 @@ class Builder {
this.args.push('--profile', this.options.profile) this.args.push('--profile', this.options.profile)
} }
if (this.options.manifestPath) {
this.args.push('--manifest-path', this.options.manifestPath)
}
if (this.options.cargoOptions?.length) { if (this.options.cargoOptions?.length) {
this.args.push(...this.options.cargoOptions) this.args.push(...this.options.cargoOptions)
} }
@ -745,7 +749,7 @@ class Builder {
return return
} }
const name = parse(this.options.jsBinding ?? 'index.js').name const name = this.options.jsBinding ?? 'index.js'
const cjs = createCjsBinding( const cjs = createCjsBinding(
this.config.binaryName, this.config.binaryName,
@ -754,7 +758,7 @@ class Builder {
) )
try { try {
const dest = join(this.outputDir, `${name}.js`) const dest = join(this.outputDir, name)
debug('Writing js binding to:') debug('Writing js binding to:')
debug(' %i', dest) debug(' %i', dest)
await writeFileAsync(dest, cjs, 'utf-8') await writeFileAsync(dest, cjs, 'utf-8')