Skip to content

Commit

Permalink
fix(uninstall): filter flags from packages
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Nov 20, 2023
1 parent c5420ef commit e0799e7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/commands/uninstall.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
use crate::utils::{helpers, node};
use helpers::Result;

pub fn run(name: Vec<String>, global: bool) -> Result<()> {
node::uninstall(&name, global);
pub fn run(packages: Vec<String>, global: bool) -> Result<()> {
let packages = packages
.iter()
// Filter out any flags
// This can happen when passing args using `--`
// For example: `supreme install is-even -- -W`
.filter(|p| !p.starts_with('-'))
.map(|p| p.to_string())
.collect::<Vec<String>>();

node::uninstall(&packages, global);

Ok(())
}

0 comments on commit e0799e7

Please sign in to comment.