Skip to content

Commit 29d8021

Browse files
committed
added suggested simplification
1 parent d15208f commit 29d8021

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/ferric/src/cargo.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ type BuildOptions = {
7676

7777
export async function build(options: BuildOptions) {
7878
const { target, configuration } = options;
79-
const modeConfig = configuration.toLowerCase() === "release" ? "--release" : "";
80-
const cargoBuildArgs = ["build", "--target", target, modeConfig].filter(item => String(item).length > 0)
81-
await spawn("cargo", cargoBuildArgs, {
79+
const args = ["build", "--target", target]
80+
if (configuration.toLowerCase() === 'release') {
81+
args.push('--release')
82+
}
83+
await spawn("cargo", args, {
8284
outputMode: "buffered",
8385
env: {
8486
...process.env,
@@ -89,7 +91,7 @@ export async function build(options: BuildOptions) {
8991
process.cwd(),
9092
"target",
9193
target,
92-
modeConfig
94+
configuration
9395
);
9496
const dynamicLibraryFile = fs
9597
.readdirSync(targetOutputPath)

0 commit comments

Comments
 (0)