mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Support equals sign in shorthand environment variable values (#3869)
Some environment variables, such as `RUST_LOG` include equals signs. Nushell should support this in the shorthand environment variable syntax so that developers using these variables can control them easily. We accomplish this by swapping `std::str::split` for `std::str::splitn`, which ensures that we only consider the first equals sign in the string instead of all of them, which we did previously. Closes #3867
This commit is contained in:
@ -1997,7 +1997,7 @@ fn expand_shorthand_forms(
|
||||
if lite_pipeline.commands[0].parts[0].contains('=')
|
||||
&& !lite_pipeline.commands[0].parts[0].starts_with('$')
|
||||
{
|
||||
let assignment: Vec<_> = lite_pipeline.commands[0].parts[0].split('=').collect();
|
||||
let assignment: Vec<_> = lite_pipeline.commands[0].parts[0].splitn(2, '=').collect();
|
||||
if assignment.len() != 2 {
|
||||
(
|
||||
lite_pipeline.clone(),
|
||||
|
Reference in New Issue
Block a user