Skip to content

Commit

Permalink
Fix self uninstall on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
D4isDAVID committed Jun 17, 2024
1 parent e3023ca commit 4a15223
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
77 changes: 77 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fern = "0.6.2"
fs-err = { version = "2.11" }
lazycell = "1.3"
log = "0.4.21"
self-replace = "1.3"
serde = { version = "1.0", features = ["derive"] }
toml = { version = "0.8.14", features = ["preserve_order"] }

Expand Down
3 changes: 3 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ impl CliContext {
pub fn uninstall(&self) -> anyhow::Result<()> {
let home_dir = self.home.path();

log::trace!("deleting self");
self_replace::self_delete_outside_path(home_dir)?;

log::trace!("deleting home dir");
fs_err::remove_dir_all(home_dir)?;

Expand Down

0 comments on commit 4a15223

Please sign in to comment.