Skip to content

Commit 257ca09

Browse files
committed
[rust] Enhance logic to uncompress DEB files and set toolchain version
1 parent fbf75fd commit 257ca09

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

WORKSPACE

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,12 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_regi
239239

240240
rules_rust_dependencies()
241241

242-
rust_register_toolchains()
242+
rust_register_toolchains(
243+
edition = "2021",
244+
versions = [
245+
"1.77.0",
246+
],
247+
)
243248

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

rust/src/files.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,10 @@ pub fn uncompress_deb(
273273
opt_edge_str, target_str
274274
));
275275
create_parent_path_if_not_exists(target)?;
276-
let output = run_shell_command_by_os(os, command)?;
277-
if output.is_empty() {
276+
run_shell_command_by_os(os, command)?;
277+
let target_path = Path::new(target);
278+
if target_path.parent().unwrap().read_dir()?.next().is_none() {
279+
println!("IS EMPTY");
278280
fs::rename(&opt_edge_str, &target_str)?;
279281
}
280282

0 commit comments

Comments
 (0)