mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-15 20:28:04 +08:00
nushell: [install] Query nu for autoload directory
Nushell uses platform-native config dirs (Application Support on macOS, AppData on Windows), so $XDG_CONFIG_HOME/nushell/autoload is wrong outside Linux and the generated file is silently ignored. Ask `nu` for `$nu.user-autoload-dirs` instead. Safe because the earlier shells loop already drops `nushell` from $shells when `nu` is not on PATH.
This commit is contained in:
@@ -10,7 +10,6 @@ shells="bash zsh fish nushell"
|
|||||||
prefix='~/.fzf'
|
prefix='~/.fzf'
|
||||||
prefix_expand=~/.fzf
|
prefix_expand=~/.fzf
|
||||||
fish_dir=${XDG_CONFIG_HOME:-$HOME/.config}/fish
|
fish_dir=${XDG_CONFIG_HOME:-$HOME/.config}/fish
|
||||||
nushell_autoload_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nushell/autoload
|
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@@ -446,6 +445,7 @@ fi
|
|||||||
if [[ "$shells" =~ nushell ]]; then
|
if [[ "$shells" =~ nushell ]]; then
|
||||||
if [[ $key_bindings -eq 1 || $auto_completion -eq 1 ]]; then
|
if [[ $key_bindings -eq 1 || $auto_completion -eq 1 ]]; then
|
||||||
echo "Setting up Nushell integration ..."
|
echo "Setting up Nushell integration ..."
|
||||||
|
nushell_autoload_dir=$(nu -c '$nu.user-autoload-dirs | first')
|
||||||
mkdir -p "$nushell_autoload_dir"
|
mkdir -p "$nushell_autoload_dir"
|
||||||
dest="$nushell_autoload_dir/_fzf_integration.nu"
|
dest="$nushell_autoload_dir/_fzf_integration.nu"
|
||||||
echo -n " Generate $dest ... "
|
echo -n " Generate $dest ... "
|
||||||
|
|||||||
Reference in New Issue
Block a user