add protections against nuking curze

This commit is contained in:
abbie 2023-08-10 12:28:34 +01:00
parent 993af25bdf
commit 18f498bb77
Signed by: threeoh6000
GPG key ID: 801FE4AD456E922C
4 changed files with 10 additions and 3 deletions

View file

@ -1 +1 @@
1
2

2
Cargo.lock generated
View file

@ -197,7 +197,7 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
[[package]]
name = "curze"
version = "0.3.1"
version = "0.3.2"
dependencies = [
"clap",
"home",

View file

@ -1,6 +1,6 @@
[package]
name = "curze"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -142,6 +142,13 @@ fn uninstall_package(package: String) {
return;
}
if package == "meta/curze" {
println!("EROR: curze cannot be uninstalled automatically.");
println!("EROR: Removing curze is not recommended without first uninstalling everything");
println!("EROR: and verifying it all before uninstalling manually.");
return;
}
if Path::new(&format!("{}/.local/share/curze/{}.version", home, realised_name)).exists() {
if Path::new(&format!("{}/.local/share/curze/cache/{}/", home, realised_name)).exists() { }
else {