use crate::{
find::{Bump, Find},
pm::{
core::{
types::{Categorizable, Category, PmInfo},
updater::update_cmd,
upstream::Upstream,
},
find_all_pms,
},
};
pub struct Ni;
impl Ni {
const NAME: &'static str = "ni";
}
impl Find for Ni {
type Output = PmInfo;
fn name(&self) -> &'static str {
Self::NAME
}
fn find(&self) -> Vec<PmInfo> {
find_all_pms(Self::NAME)
}
fn check_bump(&self, pm_info: &PmInfo) -> Option<Bump> {
let http = ureq::agent();
let latest = Upstream::Npm("@antfu/ni").latest(&http).ok()?;
let cmd = update_cmd(Self::NAME, &pm_info.install_method);
Some(Bump { latest, cmd })
}
}
impl Categorizable for Ni {
fn category(&self) -> Category {
Category::Wrapper
}
}