mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-25 22:17:33 +00:00
Update nushell env update syntax (#587)
This commit is contained in:
parent
5f8974fc5c
commit
786519aa8f
@ -13,20 +13,20 @@
|
|||||||
{%- else -%}
|
{%- else -%}
|
||||||
# Initialize hook to add new entries to the database.
|
# Initialize hook to add new entries to the database.
|
||||||
if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) {
|
if (not ($env | default false __zoxide_hooked | get __zoxide_hooked)) {
|
||||||
let-env __zoxide_hooked = true
|
$env.__zoxide_hooked = true
|
||||||
{%- if hook == InitHook::Prompt %}
|
{%- if hook == InitHook::Prompt %}
|
||||||
let-env config = ($env | default {} config).config
|
$env.config = ($env | default {} config).config
|
||||||
let-env config = ($env.config | default {} hooks)
|
$env.config = ($env.config | default {} hooks)
|
||||||
let-env config = ($env.config | update hooks ($env.config.hooks | default [] pre_prompt))
|
$env.config = ($env.config | update hooks ($env.config.hooks | default [] pre_prompt))
|
||||||
let-env config = ($env.config | update hooks.pre_prompt ($env.config.hooks.pre_prompt | append { ||
|
$env.config = ($env.config | update hooks.pre_prompt ($env.config.hooks.pre_prompt | append { ||
|
||||||
zoxide add -- $env.PWD
|
zoxide add -- $env.PWD
|
||||||
}))
|
}))
|
||||||
{%- else if hook == InitHook::Pwd %}
|
{%- else if hook == InitHook::Pwd %}
|
||||||
let-env config = ($env | default {} config).config
|
$env.config = ($env | default {} config).config
|
||||||
let-env config = ($env.config | default {} hooks)
|
$env.config = ($env.config | default {} hooks)
|
||||||
let-env config = ($env.config | update hooks ($env.config.hooks | default {} env_change))
|
$env.config = ($env.config | update hooks ($env.config.hooks | default {} env_change))
|
||||||
let-env config = ($env.config | update hooks.env_change ($env.config.hooks.env_change | default [] PWD))
|
$env.config = ($env.config | update hooks.env_change ($env.config.hooks.env_change | default [] PWD))
|
||||||
let-env config = ($env.config | update hooks.env_change.PWD ($env.config.hooks.env_change.PWD | append {|_, dir|
|
$env.config = ($env.config | update hooks.env_change.PWD ($env.config.hooks.env_change.PWD | append {|_, dir|
|
||||||
zoxide add -- $dir
|
zoxide add -- $dir
|
||||||
}))
|
}))
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user