From 53cbca7ae6e3c1e37e59cafcd45efdba65c732ed Mon Sep 17 00:00:00 2001 From: Naz Date: Tue, 29 Jul 2025 16:28:14 +0100 Subject: =?UTF-8?q?=F0=9F=94=A7refactor:=20move=20the=20symlink=20removal?= =?UTF-8?q?=20logic=20to=20SymlinkManager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/symlink.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/symlink.rs b/src/symlink.rs index 3883172..843115c 100644 --- a/src/symlink.rs +++ b/src/symlink.rs @@ -10,6 +10,14 @@ impl SymlinkManager { pub fn new() -> Self { Self {} } + pub async fn remove(&self, executable: &str) -> Result<(), Box> { + let home = std::env::var("HOME")?; + let symlink_path = PathBuf::from(home).join(".local/bin").join(executable); + + fs::remove_file(symlink_path).await?; + + Ok(()) + } pub async fn create(&self, appimage: &AppImage) -> Result<(), Box> { let home = std::env::var("HOME")?; let local_bin = PathBuf::from(home).join(".local/bin"); -- cgit v1.2.3