diff --git a/fish/conf.d/10-core.fish b/fish/conf.d/10-core.fish index 486ee74..3ed8176 100644 --- a/fish/conf.d/10-core.fish +++ b/fish/conf.d/10-core.fish @@ -42,7 +42,7 @@ end set -gx VISUAL "$EDITOR" if test (uname) = Linux - for nix_profile_bin in /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin" "$HOME/.local/bin" + for nix_profile_bin in /nix/var/nix/profiles/default/bin "$HOME/.nix-profile/bin" "$HOME/.local/share/mise/shims" "$HOME/.opencode/bin" "$HOME/.local/bin" if test -d "$nix_profile_bin" fish_add_path --path --move "$nix_profile_bin" end diff --git a/fish/tests/w2-core.fish b/fish/tests/w2-core.fish index e504a54..8a1a8ee 100644 --- a/fish/tests/w2-core.fish +++ b/fish/tests/w2-core.fish @@ -91,17 +91,25 @@ chmod +x "$bin/uname" set -l linux_open_alias (run_fish -c 'functions -q o; and echo defined; or echo absent') assert_equal "$linux_open_alias" absent 'Linux Fish startup excludes the macOS open alias' -mkdir -p "$home/.local/bin" "$home/.nix-profile/bin" +mkdir -p "$home/.local/bin" "$home/.opencode/bin" "$home/.local/share/mise/shims" "$home/.nix-profile/bin" printf '#!/bin/sh\n' >"$home/.local/bin/w2-local-command" chmod +x "$home/.local/bin/w2-local-command" +printf '#!/bin/sh\n' >"$home/.opencode/bin/w2-opencode-command" +chmod +x "$home/.opencode/bin/w2-opencode-command" +printf '#!/bin/sh\n' >"$home/.local/share/mise/shims/w2-mise-command" +chmod +x "$home/.local/share/mise/shims/w2-mise-command" printf '#!/bin/sh\n' >"$home/.nix-profile/bin/w2-profile-command" chmod +x "$home/.nix-profile/bin/w2-profile-command" set -l linux_local_command (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; command -s w2-local-command") assert_equal "$linux_local_command" "$home/.local/bin/w2-local-command" 'Linux Fish startup resolves commands from the user-local bin directory' +set -l linux_opencode_command (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; command -s w2-opencode-command") +assert_equal "$linux_opencode_command" "$home/.opencode/bin/w2-opencode-command" 'Linux Fish startup resolves commands from the OpenCode bin directory' +set -l linux_mise_command (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; command -s w2-mise-command") +assert_equal "$linux_mise_command" "$home/.local/share/mise/shims/w2-mise-command" 'Linux Fish startup resolves commands from the mise shims directory' set -l linux_profile_command (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; command -s w2-profile-command") assert_equal "$linux_profile_command" "$home/.nix-profile/bin/w2-profile-command" 'Linux Fish startup resolves commands from the user Nix profile' set -l linux_path (run_clean_fish -c "source '$xdg/fish/conf.d/10-core.fish'; string join '|' \$PATH") -string match -q "$home/.local/bin|$home/.nix-profile/bin|*" "$linux_path"; or fail 'Linux Fish startup orders user-local bin before the user Nix profile' +string match -q "$home/.local/bin|$home/.opencode/bin|$home/.local/share/mise/shims|$home/.nix-profile/bin|*" "$linux_path"; or fail 'Linux Fish startup orders portable tool directories before the user Nix profile' printf '#!/bin/sh\n[ "$1" = init ] && printf "set -gx W2_STARSHIP_READY 1\\n"\n' >"$bin/starship" chmod +x "$bin/starship"