upgrade and remove
change owvswnyzoqxyrwwsxryontvzxonuxxns
commit e841dff3e81c114fbe2cd99592f49d01bd3d11e4
author Alpha Chen <alpha@kejadlen.dev>
date
parent ssouvpwz
diff --git a/frork-cli/src/assertions.rs b/frork-cli/src/assertions.rs
index 95c0387..d0462bc 100644
--- a/frork-cli/src/assertions.rs
+++ b/frork-cli/src/assertions.rs
@@ -99,6 +99,8 @@ impl FromLuaMulti for Status {
 pub trait AssertionType: std::fmt::Display {
     fn status(&self) -> Result<Status>;
     fn install(&self) -> Result<()>;
+    fn upgrade(&self) -> Result<()>;
+    fn remove(&self) -> Result<()>;
 }
 
 #[derive(Clone)]
@@ -178,6 +180,14 @@ impl AssertionType for Symlink {
         debug!("created: {}", self);
         Ok(())
     }
+
+    fn upgrade(&self) -> Result<()> {
+        todo!()
+    }
+
+    fn remove(&self) -> Result<()> {
+        todo!()
+    }
 }
 
 pub struct Directory {
@@ -218,6 +228,14 @@ impl AssertionType for Directory {
         debug!("created: {}", self);
         Ok(())
     }
+
+    fn upgrade(&self) -> Result<()> {
+        todo!()
+    }
+
+    fn remove(&self) -> Result<()> {
+        todo!()
+    }
 }
 
 pub struct Debug {
@@ -266,6 +284,14 @@ impl AssertionType for Debug {
             .map_err(|e| eyre!("Debug install function failed: {}", e))?;
         Ok(())
     }
+
+    fn upgrade(&self) -> Result<()> {
+        todo!()
+    }
+
+    fn remove(&self) -> Result<()> {
+        todo!()
+    }
 }
 
 pub struct Git {
@@ -363,6 +389,14 @@ impl AssertionType for Git {
         debug!("created: {}", self);
         Ok(())
     }
+
+    fn upgrade(&self) -> Result<()> {
+        todo!()
+    }
+
+    fn remove(&self) -> Result<()> {
+        todo!()
+    }
 }
 
 pub struct LuaAssertion {
@@ -425,6 +459,14 @@ impl AssertionType for LuaAssertion {
         debug!("installed: {}", self);
         Ok(())
     }
+
+    fn upgrade(&self) -> Result<()> {
+        todo!()
+    }
+
+    fn remove(&self) -> Result<()> {
+        todo!()
+    }
 }
 
 pub struct Brew;
@@ -467,6 +509,14 @@ impl AssertionType for Brew {
         debug!("installed: {}", self);
         Ok(())
     }
+
+    fn upgrade(&self) -> Result<()> {
+        todo!()
+    }
+
+    fn remove(&self) -> Result<()> {
+        todo!()
+    }
 }
 
 pub struct BrewBundle {
@@ -556,4 +606,12 @@ impl AssertionType for BrewBundle {
         debug!("installed: {}", self);
         Ok(())
     }
+
+    fn upgrade(&self) -> Result<()> {
+        todo!()
+    }
+
+    fn remove(&self) -> Result<()> {
+        todo!()
+    }
 }
diff --git a/frork-cli/src/main.rs b/frork-cli/src/main.rs
index a6d7486..b28a13b 100644
--- a/frork-cli/src/main.rs
+++ b/frork-cli/src/main.rs
@@ -307,7 +307,7 @@ fn satisfy(status: &Status, assertion: &dyn AssertionType) -> Result<()> {
 
             match input.trim().to_lowercase().as_str() {
                 "y" | "yes" => {
-                    assertion.install()?;
+                    assertion.upgrade()?;
                     println!("ok: {}", assertion);
                 }
                 _ => {