Skip to content

Commit

Permalink
fix: update wizer version in docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxiaohei committed Aug 27, 2024
1 parent 2b6f38d commit 9c18417
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion land-server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ RUN \
apt-get install -y ca-certificates && \
apt-get clean
COPY --from=build /usr/src/land-server/target/release/land-server /opt/bin/land-server
COPY --from=build /usr/src/land-server/wizer-v6.0.0-x86_64-linux /opt/bin/wizer
COPY --from=build /usr/src/land-server/wizer-v7.0.4-x86_64-linux /opt/bin/wizer
EXPOSE 9840
CMD ["/opt/bin/land-server","--verbose"]
22 changes: 18 additions & 4 deletions lib/wasm-gen/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::{anyhow, Result};
use std::{
collections::HashMap,
env::current_dir,
env::{current_dir, current_exe},
io::Write,
path::{Path, PathBuf},
process::{Command, Stdio},
Expand Down Expand Up @@ -64,7 +64,7 @@ fn find_cmd(cmd: &str) -> Result<PathBuf> {
let c = match which::which(cmd) {
Ok(c) => c,
Err(_) => {
// find xxx binary in current exe directroy ./xxx/xxx
// find xxx binary in current work directroy ./xxx/xxx
let exe_path = current_dir()?;
let file = exe_path.parent().unwrap().join(format!("{}/{}", cmd, cmd));

Expand All @@ -75,10 +75,24 @@ fn find_cmd(cmd: &str) -> Result<PathBuf> {
if file.exists() {
return Ok(file);
}

// find xxx binary in current executable file
let exe_path2 = current_exe()?;
let file2 = exe_path2.parent().unwrap().join(format!("{}/{}", cmd, cmd));

#[cfg(target_os = "windows")]
let file2 = file2.with_extension("exe");

debug!("Try find cmd: {:?}", file2);
if file2.exists() {
return Ok(file2);
}

return Err(anyhow!(
"cannot find '{}' binary, it should in $PATH or {:?}",
"cannot find '{}' binary, it should in $PATH or {:?} or {:?}",
cmd,
file
file,
file2,
));
}
};
Expand Down

0 comments on commit 9c18417

Please sign in to comment.