-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Description
Summary
When Granted is installed via Nix, the assume.fish and assume.tcsh scripts are placed in the share/ directory rather than bin/. However, the alias setup code in pkg/alias/alias.go only knows about:
/usr/local/bin/assume.fish(default)$(brew --prefix)/bin/assume.fish(Homebrew)
This causes fish and tcsh users on Nix to get a broken alias that points to a non-existent path.
Actual paths on Nix
$ which granted
/nix/store/ga93f7hvqn2zbnkdmghy5whsmwg3vbdw-granted-0.38.0/bin/granted
$ ls /nix/store/ga93f7hvqn2zbnkdmghy5whsmwg3vbdw-granted-0.38.0/share/
assume.fish
$ ls /nix/store/ga93f7hvqn2zbnkdmghy5whsmwg3vbdw-granted-0.38.0/bin/
assume assumego granted
Note: bin/assume is the POSIX shell script (bash/zsh), not the fish script.
Root cause
The nixpkgs package correctly installs assume.fish to share/ (following FHS conventions), but GetFishAlias() and GetTcshAlias() in pkg/alias/alias.go don't detect Nix installations.
Fix
PR #921 adds Nix detection by checking if the granted binary is in /nix/store/, then constructs the correct path to share/assume.fish.
Environment
- Granted version: 0.38.0
- Shell: fish 3.x
- Install method: Nix
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels