Repository navigation
feat: add nushell's plugin management commands (plugin list, stop, use, ...) - #56
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
nu-cmd-plugincommand context (0.116.0, matching the other nu crates) to the engine inEngine::new, so scripts can useplugin list,plugin stop,plugin use,plugin addandplugin rm. Previously these failed with "Commandpluginnot found".The use case is a served script checking on a plugin loaded with
--plugin, e.g.plugin list --engine | where name == foo | get pid.0to see whether the plugin process exited and was respawned.Changes:
Cargo.toml/Cargo.lock: addnu-cmd-plugin = "0.116.0", locked at 0.116.0 so the other nu crates stay on 0.116.0.src/engine.rs: callnu_cmd_plugin::add_plugin_command_context.README.md: note in the Plugins section that the plugin commands are available.Tests:
server_test::test_plugin_list_engine: a served closure with the test plugin loaded;plugin list --enginereports statusrunningand a pid equal to the onetest-plugin-pidreturns.eval_test::test_eval_plugin_stop_respawns: afterplugin stop test, the next plugin call runs in a new process andplugin list --enginereports the new pid.cargo fmt --check,cargo clippy(flags fromscripts/check.sh),cargo test, the threetests/*.nusuites and the two example tests pass.deno fmt README.md --checkwas not run (deno not installed on the machine).