Skip to content

Commit 18a0719

Browse files
committed
fix: unit test failing
Signed-off-by: Bailey Hayes <behayes2@gmail.com>
1 parent bfa8c3b commit 18a0719

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/wash/src/cli/component_build.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ pub struct ComponentBuildCommand {
4242
#[clap(long = "skip-fetch")]
4343
skip_fetch: bool,
4444

45-
/// The arguments to pass to the native build tool (cargo, tinygo, npm, etc.)
45+
/// Additional arguments to pass to the native build tool after '--'.
46+
/// Example: wash build -- --release --features extra
4647
#[clap(name = "arg", trailing_var_arg = true, allow_hyphen_values = true)]
4748
pub args: Vec<String>,
4849
}
@@ -61,15 +62,15 @@ impl CliCommand for ComponentBuildCommand {
6162
..Default::default()
6263
})
6364
}
64-
if let Some(build) = config.build.as_mut() {
65-
if !self.args.is_empty() {
65+
if !self.args.is_empty() {
66+
if let Some(build) = config.build.as_mut() {
6667
build.additional_args = self.args.clone();
68+
} else {
69+
config.build = Some(crate::component_build::BuildConfig {
70+
additional_args: self.args.clone(),
71+
..Default::default()
72+
});
6773
}
68-
} else {
69-
config.build = Some(crate::component_build::BuildConfig {
70-
additional_args: self.args.clone(),
71-
..Default::default()
72-
});
7374
}
7475
let result = build_component(&self.project_path, ctx, &config).await?;
7576

@@ -560,7 +561,7 @@ impl ComponentBuilder {
560561
|| config
561562
.build
562563
.as_ref()
563-
.map(|b| b.additional_args.contains(&"--release".to_string()))
564+
.map(|b| b.additional_args.iter().any(|arg| arg == "--release"))
564565
.unwrap_or(false);
565566

566567
// Apply release mode if configured

crates/wash/src/cli/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl TestCommand {
383383
) =>
384384
{
385385
let _ = e.print();
386-
return Ok(CommandOutput::error("", None));
386+
return Ok(CommandOutput::error(e.to_string(), None));
387387
}
388388
Err(e) => anyhow::bail!("Failed to parse command arguments: {}", e),
389389
};

crates/wash/src/component_build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub struct BuildConfig {
2424
#[serde(skip_serializing_if = "Option::is_none")]
2525
pub component_path: Option<PathBuf>,
2626

27+
/// Additional arguments to pass to the build toolchain (cargo, tinygo, npm)
2728
#[serde(skip_serializing_if = "Vec::is_empty", default)]
2829
pub additional_args: Vec<String>,
2930
}

0 commit comments

Comments
 (0)