mirror of
https://github.com/nushell/nushell
synced 2024-12-26 04:53:09 +00:00
Ignore empty arguments passed to externals (#1722)
This commit is contained in:
parent
8a9fc6a721
commit
7ce8026916
1 changed files with 6 additions and 0 deletions
|
@ -116,6 +116,12 @@ fn run_with_stdin(
|
|||
let mut command_args = vec![];
|
||||
for arg in command.args.iter() {
|
||||
let value = evaluate_baseline_expr(arg, &context.registry, scope)?;
|
||||
// Skip any arguments that don't really exist, treating them as optional
|
||||
// FIXME: we may want to preserve the gap in the future, though it's hard to say
|
||||
// what value we would put in its place.
|
||||
if value.value.is_none() {
|
||||
continue;
|
||||
}
|
||||
// Do the cleanup that we need to do on any argument going out:
|
||||
let trimmed_value_string = value.as_string()?.trim_end_matches('\n').to_string();
|
||||
|
||||
|
|
Loading…
Reference in a new issue