mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +02:00
Core nu plugin load capability. (#2544)
We introduce the `plugin` nu sub command (`nu plugin`) with basic plugin loading support. We can choose to load plugins from a directory. Originally introduced to make integration tests faster (by not loading any plugins on startup at all) but `nu plugin --load some_path ; test_pipeline_that_uses_plugins_just_loaded` does not see it. Therefore, a `nu_with_plugins!` macro for tests was introduced on top of nu`s `--skip-plugins` switch executable which is set to true when running the integration tests that use the `nu!` macro now..
This commit is contained in:
committed by
GitHub
parent
e05e6b42fe
commit
0178b53289
14
src/main.rs
14
src/main.rs
@ -17,6 +17,13 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
.possible_values(&["error", "warn", "info", "debug", "trace"])
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("skip-plugins")
|
||||
.hidden(true)
|
||||
.long("skip-plugins")
|
||||
.multiple(false)
|
||||
.takes_value(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("testbin")
|
||||
.hidden(true)
|
||||
@ -154,7 +161,12 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
None => {
|
||||
let mut syncer = EnvironmentSyncer::new();
|
||||
let context = create_default_context(&mut syncer, true)?;
|
||||
let mut context = create_default_context(&mut syncer, true)?;
|
||||
|
||||
if !matches.is_present("skip-plugins") {
|
||||
let _ = nu_cli::register_plugins(&mut context);
|
||||
}
|
||||
|
||||
futures::executor::block_on(nu_cli::cli(syncer, context))?;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user