diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-12-26 17:15:39 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-12-26 17:15:39 +0100 |
commit | 476e08064f456573e3ee655775d6179d20344511 (patch) | |
tree | 9597feb2d90282fdb54ac73776389dda9c346134 /src/main.rs | |
parent | 17a6bd1d1df8db82c478edd57270c12fb3256071 (diff) |
fix object copying and deletion
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 9520ca8..b6bb56d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,11 +105,14 @@ fn main() -> anyhow::Result<()> { let kernel_path = "arch/x86_64/boot/bzImage"; /* FIXME: arch independent */ - copy_file(kernel_path, "vmlinuz")?; - env::set_current_dir(current_dir)?; - fs::remove_file(file_name)?; + copy_file( + Path::new(file_name.trim_end_matches(".tar.xz")).join(kernel_path), + "vmlinuz", + )?; + + fs::remove_dir_all(file_name)?; fs::remove_file(file_name.trim_end_matches(".tar.xz"))?; Ok(()) |