Skip to content

Commit

Permalink
refactor: rename External plugins to Asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 31, 2024
1 parent 402c5ce commit 8e774ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cli/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl Doctor {
let is_core = CORE_PLUGINS.iter().any(|fg| fg.id() == plugin.id());
let plugin_type = plugin.get_plugin_type();

if is_core && plugin_type == PluginType::External {
if is_core && plugin_type == PluginType::Asdf {
self.warnings
.push(format!("plugin {} overrides a core plugin", &plugin.id()));
}
Expand Down Expand Up @@ -269,7 +269,7 @@ fn render_plugins() -> String {
.map(|p| {
let padded_name = pad_str(p.id(), max_plugin_name_len, Alignment::Left, None);
let extra = match p.get_plugin_type() {
PluginType::External => {
PluginType::Asdf => {
let git = Git::new(dirs::PLUGINS.join(p.id()));
match git.get_remote_url() {
Some(url) => {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/plugins/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl PluginsLs {
} else if self.core {
tools.retain(|p| matches!(p.get_plugin_type(), PluginType::Core));
} else {
tools.retain(|p| matches!(p.get_plugin_type(), PluginType::External));
tools.retain(|p| matches!(p.get_plugin_type(), PluginType::Asdf));
}

if self.urls || self.refs {
Expand Down
2 changes: 1 addition & 1 deletion src/forge/asdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl Forge for Asdf {
}

fn get_plugin_type(&self) -> PluginType {
PluginType::External
PluginType::Asdf
}

fn get_dependencies(&self, tvr: &ToolRequest) -> Result<Vec<ForgeArg>> {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub mod script_manager;
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum PluginType {
Core,
External,
Asdf,
}

pub static VERSION_REGEX: Lazy<regex::Regex> = Lazy::new(|| {
Expand All @@ -40,7 +40,7 @@ pub fn list() -> ForgeList {
pub fn list_external() -> ForgeList {
list()
.into_iter()
.filter(|tool| tool.get_plugin_type() == PluginType::External)
.filter(|tool| tool.get_plugin_type() == PluginType::Asdf)
.collect()
}

Expand Down

0 comments on commit 8e774ba

Please sign in to comment.