nushell: fix get -i deprecation (#7490)

Since https://github.com/nushell/nushell/pull/16007, the recommended
flag to avoid erroring on missing fields is `--optional`. To avoid
compatibility issues, the builtin optional access syntax is used
instead, which is backwards-compatible.
This commit is contained in:
Joaquín Triñanes 2025-07-17 21:15:13 +02:00 committed by GitHub
parent 8eb2f2a26a
commit 50adf43449
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -193,8 +193,8 @@ in
}
}
| merge ($env.ENV_CONVERSIONS? | default {})
| get -i ([[value, optional, insensitive]; [$key, false, true]] | into cell-path)
| get -i from_string
| get ([[value, optional, insensitive]; [$key, true, true]] | into cell-path)
| get from_string?
| if ($in | is-empty) { {|x| $x} } else { $in }
) $value
return [ $key $value ]