feat(cli): detect Cargo --profile argument (#1598)

This commit is contained in:
Lucas Fernandes Nogueira 2023-05-26 19:19:16 -07:00 committed by GitHub
parent c6258cf633
commit 85836034ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -460,12 +460,13 @@ class Builder {
return
}
const src = join(
this.targetDir,
this.target.triple,
this.options.release ? 'release' : 'debug',
srcName,
)
let outputFolder = this.options.release ? 'release' : 'debug'
if (this.options.cargoOptions?.includes('--profile')) {
const args = this.options.cargoOptions
const profileIndex = args.indexOf('--profile')
outputFolder = args[profileIndex + 1]
}
const src = join(this.targetDir, this.target.triple, outputFolder, srcName)
const dest = join(this.outputDir, destName)
try {