From 85836034ff522dedcd694debd2e0e2046aa97776 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 26 May 2023 19:19:16 -0700 Subject: [PATCH] feat(cli): detect Cargo `--profile` argument (#1598) --- cli/src/api/build.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cli/src/api/build.ts b/cli/src/api/build.ts index 0512c648..ec47de22 100644 --- a/cli/src/api/build.ts +++ b/cli/src/api/build.ts @@ -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 {