feat: add dir to path if not already there

This commit is contained in:
Erica Marigold 2023-09-30 17:09:49 +05:30
parent 5ba332acce
commit c0140d6523

View file

@ -28,12 +28,16 @@ fn main() {
let (zip_path, meta) = download_release(version).expect_or_log("failed to download latest lune release");
install_lune(
let mut install_path = install_lune(
File::open(&zip_path).unwrap_or_else(|_| panic!("failed to open downloaded lune release zip file @ {}", zip_path.to_string_lossy())),
meta,
)
.expect_or_log("failed to install lune. did we not have perms to write to the required directories?");
install_path.pop();
core::add_path(install_path.to_string_lossy());
// Cleanup downloaded & unzipped stuff
let to_remove = read_dir(".")
.expect_or_log("failed to read current working directory")