nushell: fix get -i deprecation (#2829)

Since https://github.com/nushell/nushell/pull/16007, the recommended
flag 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-23 13:28:54 +02:00
committed by GitHub
parent e31d3e849d
commit e7a8e040cc

View File

@@ -15,7 +15,7 @@ hide-env -i ATUIN_HISTORY_ID
let ATUIN_KEYBINDING_TOKEN = $"# (random uuid)"
let _atuin_pre_execution = {||
if ($nu | get -i history-enabled) == false {
if ($nu | get history-enabled?) == false {
return
}
let cmd = (commandline)
@@ -65,9 +65,9 @@ $env.config = (
$env.config | upsert hooks (
$env.config.hooks
| upsert pre_execution (
$env.config.hooks | get -i pre_execution | default [] | append $_atuin_pre_execution)
$env.config.hooks | get pre_execution? | default [] | append $_atuin_pre_execution)
| upsert pre_prompt (
$env.config.hooks | get -i pre_prompt | default [] | append $_atuin_pre_prompt)
$env.config.hooks | get pre_prompt? | default [] | append $_atuin_pre_prompt)
)
)