refactor: remove initialize() call and use plugin outputs directly
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -234,47 +234,32 @@ impl MetaPlugin for HostnameMetaPlugin {
|
||||
}
|
||||
};
|
||||
|
||||
// Always process all outputs, setting disabled ones to Null
|
||||
// Update outputs based on enabled status
|
||||
// Handle hostname output
|
||||
let hostname_output_value = if hostname_enabled {
|
||||
serde_yaml::Value::String(hostname_value)
|
||||
if hostname_enabled {
|
||||
if let Some(output_value) = self.outputs.get_mut("hostname") {
|
||||
*output_value = serde_yaml::Value::String(hostname_value);
|
||||
}
|
||||
} else {
|
||||
serde_yaml::Value::Null
|
||||
};
|
||||
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
|
||||
"hostname",
|
||||
hostname_output_value,
|
||||
&self.outputs
|
||||
) {
|
||||
metadata.push(meta_data);
|
||||
self.outputs.insert("hostname".to_string(), serde_yaml::Value::Null);
|
||||
}
|
||||
|
||||
// Handle hostname_full output
|
||||
let hostname_full_output_value = if hostname_full_enabled {
|
||||
serde_yaml::Value::String(full_hostname.clone())
|
||||
if hostname_full_enabled {
|
||||
if let Some(output_value) = self.outputs.get_mut("hostname_full") {
|
||||
*output_value = serde_yaml::Value::String(full_hostname.clone());
|
||||
}
|
||||
} else {
|
||||
serde_yaml::Value::Null
|
||||
};
|
||||
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
|
||||
"hostname_full",
|
||||
hostname_full_output_value,
|
||||
&self.outputs
|
||||
) {
|
||||
metadata.push(meta_data);
|
||||
self.outputs.insert("hostname_full".to_string(), serde_yaml::Value::Null);
|
||||
}
|
||||
|
||||
// Handle hostname_short output
|
||||
let hostname_short_output_value = if hostname_short_enabled {
|
||||
serde_yaml::Value::String(short_hostname)
|
||||
if hostname_short_enabled {
|
||||
if let Some(output_value) = self.outputs.get_mut("hostname_short") {
|
||||
*output_value = serde_yaml::Value::String(short_hostname);
|
||||
}
|
||||
} else {
|
||||
serde_yaml::Value::Null
|
||||
};
|
||||
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
|
||||
"hostname_short",
|
||||
hostname_short_output_value,
|
||||
&self.outputs
|
||||
) {
|
||||
metadata.push(meta_data);
|
||||
self.outputs.insert("hostname_short".to_string(), serde_yaml::Value::Null);
|
||||
}
|
||||
|
||||
// Mark as finalized since this plugin only needs to run once
|
||||
|
||||
Reference in New Issue
Block a user