mirror of
https://github.com/nushell/nushell.git
synced 2025-04-14 00:08:20 +02:00
Load plugins for scripts and commands, too (#5105)
This commit is contained in:
parent
d0e636ae7a
commit
121a4f06fb
16
src/main.rs
16
src/main.rs
@ -10,8 +10,6 @@ use crate::logger::{configure, logger};
|
|||||||
use log::info;
|
use log::info;
|
||||||
use miette::Result;
|
use miette::Result;
|
||||||
#[cfg(feature = "plugin")]
|
#[cfg(feature = "plugin")]
|
||||||
use nu_cli::add_plugin_file;
|
|
||||||
#[cfg(feature = "plugin")]
|
|
||||||
use nu_cli::read_plugin_file;
|
use nu_cli::read_plugin_file;
|
||||||
use nu_cli::{
|
use nu_cli::{
|
||||||
evaluate_commands, evaluate_file, evaluate_repl, gather_parent_env_vars, get_init_cwd,
|
evaluate_commands, evaluate_file, evaluate_repl, gather_parent_env_vars, get_init_cwd,
|
||||||
@ -208,7 +206,12 @@ fn main() -> Result<()> {
|
|||||||
|
|
||||||
if let Some(commands) = &binary_args.commands {
|
if let Some(commands) = &binary_args.commands {
|
||||||
#[cfg(feature = "plugin")]
|
#[cfg(feature = "plugin")]
|
||||||
add_plugin_file(&mut engine_state, NUSHELL_FOLDER);
|
read_plugin_file(
|
||||||
|
&mut engine_state,
|
||||||
|
&mut stack,
|
||||||
|
NUSHELL_FOLDER,
|
||||||
|
is_perf_true(),
|
||||||
|
);
|
||||||
|
|
||||||
let ret_val = evaluate_commands(
|
let ret_val = evaluate_commands(
|
||||||
commands,
|
commands,
|
||||||
@ -225,7 +228,12 @@ fn main() -> Result<()> {
|
|||||||
ret_val
|
ret_val
|
||||||
} else if !script_name.is_empty() && binary_args.interactive_shell.is_none() {
|
} else if !script_name.is_empty() && binary_args.interactive_shell.is_none() {
|
||||||
#[cfg(feature = "plugin")]
|
#[cfg(feature = "plugin")]
|
||||||
add_plugin_file(&mut engine_state, NUSHELL_FOLDER);
|
read_plugin_file(
|
||||||
|
&mut engine_state,
|
||||||
|
&mut stack,
|
||||||
|
NUSHELL_FOLDER,
|
||||||
|
is_perf_true(),
|
||||||
|
);
|
||||||
|
|
||||||
let ret_val = evaluate_file(
|
let ret_val = evaluate_file(
|
||||||
script_name,
|
script_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user