Skip to content

Commit

Permalink
[rust] Enhance logic to uncompress DEB files and set toolchain version
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Mar 26, 2024
1 parent fbf75fd commit 257ca09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion WORKSPACE
Expand Up @@ -239,7 +239,12 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_regi

rules_rust_dependencies()

rust_register_toolchains()
rust_register_toolchains(
edition = "2021",
versions = [
"1.77.0",
],
)

load("@rules_rust//crate_universe:defs.bzl", "crates_repository")

Expand Down
6 changes: 4 additions & 2 deletions rust/src/files.rs
Expand Up @@ -273,8 +273,10 @@ pub fn uncompress_deb(
opt_edge_str, target_str
));
create_parent_path_if_not_exists(target)?;
let output = run_shell_command_by_os(os, command)?;
if output.is_empty() {
run_shell_command_by_os(os, command)?;
let target_path = Path::new(target);
if target_path.parent().unwrap().read_dir()?.next().is_none() {
println!("IS EMPTY");
fs::rename(&opt_edge_str, &target_str)?;
}

Expand Down

0 comments on commit 257ca09

Please sign in to comment.