Skip to content

Commit

Permalink
Merge pull request #98 from bulwark-security/fix-build-input-path
Browse files Browse the repository at this point in the history
Current directory was missing from the sub process
  • Loading branch information
sporkmonger authored Aug 2, 2023
2 parents d78bbbc + 8ab5726 commit 784508c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ pub(crate) fn build_plugin(
args.push("--release");
}

let mut command = Command::new("cargo").args(&args).spawn()?;
let mut command = Command::new("cargo")
.current_dir(path)
.args(&args)
.spawn()?;

let exit_status = command.wait()?;
if exit_status.success() {
Expand Down
7 changes: 5 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let path = path.clone().unwrap_or(current_dir.clone());
let wasm_filename = crate::build::wasm_filename(&path)?;
// Defaults to joining with the current working directory, not the input path
let output = output
let mut output = output
.clone()
.unwrap_or(current_dir.join("dist").join(wasm_filename));
.unwrap_or(current_dir.join("dist/plugins").join(&wasm_filename));
if output.is_dir() {
output = output.join(wasm_filename);
}
crate::build::build_plugin(&path, output)?;
}
None => todo!(),
Expand Down

0 comments on commit 784508c

Please sign in to comment.