mirror of
https://github.com/atuinsh/atuin.git
synced 2025-08-19 03:16:54 +02:00
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:
@@ -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)
|
||||
)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user