diff --git a/src/main.rs b/src/main.rs index 77cb651731..193284f361 100644 --- a/src/main.rs +++ b/src/main.rs @@ -267,6 +267,24 @@ fn main() -> Result<()> { }, ); + #[cfg(feature = "plugin")] + { + // Reading signatures from signature file + // The plugin.nu file stores the parsed signature collected from each registered plugin + if let Some(mut plugin_path) = nu_path::config_dir() { + // Path to store plugins signatures + plugin_path.push("nushell"); + plugin_path.push("plugin.nu"); + engine_state.plugin_signatures = Some(plugin_path.clone()); + + let plugin_filename = plugin_path.to_string_lossy().to_owned(); + + if let Ok(contents) = std::fs::read_to_string(&plugin_path) { + eval_source(&mut engine_state, &mut stack, &contents, &plugin_filename); + } + } + } + // Load config startup file if let Some(mut config_path) = nu_path::config_dir() { config_path.push("nushell"); @@ -333,24 +351,6 @@ fn main() -> Result<()> { } }); - #[cfg(feature = "plugin")] - { - // Reading signatures from signature file - // The plugin.nu file stores the parsed signature collected from each registered plugin - if let Some(mut plugin_path) = nu_path::config_dir() { - // Path to store plugins signatures - plugin_path.push("nushell"); - plugin_path.push("plugin.nu"); - engine_state.plugin_signatures = Some(plugin_path.clone()); - - let plugin_filename = plugin_path.to_string_lossy().to_owned(); - - if let Ok(contents) = std::fs::read_to_string(&plugin_path) { - eval_source(&mut engine_state, &mut stack, &contents, &plugin_filename); - } - } - } - loop { let config = match stack.get_config() { Ok(config) => config,