Skip to content

Commit

Permalink
feat(Plugins): Add command to unlink a local plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Mar 28, 2021
1 parent b7535b2 commit 66e6475
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rust/src/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ pub mod cli {
Link(Link),
Upgrade(Upgrade),
Uninstall(Uninstall),
Unlink(Unlink)
}

#[derive(Debug, StructOpt)]
Expand Down Expand Up @@ -738,6 +739,15 @@ pub mod cli {
pub plugins: Vec<String>,
}


#[derive(Debug, StructOpt)]
#[structopt(about = "Unlink a local plugins")]
pub struct Unlink {
/// The name of the plugin
#[structopt()]
pub name: String,
}

pub async fn plugins(args: Args) -> Result<()> {
let Args { action } = args;
let config::Config { kinds, aliases } = crate::config::get()?.plugins;
Expand Down Expand Up @@ -810,6 +820,11 @@ pub mod cli {

uninstall_list(plugins, &aliases)
}
Action::Unlink(action) => {
let Unlink { name } = action;

uninstall_plugin(&name)
}
}
}
}
Expand Down

0 comments on commit 66e6475

Please sign in to comment.