Fix shell integration to find fortress-bin in PATH (fixes Homebrew on macOS)
- SHA
21e301c1017385d83111c65546b7f52936a301ed- Parents
-
83b5c3e - Tree
33c9e20
21e301c
21e301c1017385d83111c65546b7f52936a301ed83b5c3e
33c9e20| Status | File | + | - |
|---|---|---|---|
| M |
fortress.fish
|
9 | 3 |
| M |
fortress.sh
|
5 | 2 |
fortress.fishmodified@@ -7,11 +7,17 @@ | ||
| 7 | 7 | function fortress --description "Navigate filesystem with FORTRESS and cd on exit" |
| 8 | 8 | # Set fortress directory - prefer system install, fallback to FORTRESS_DIR env var |
| 9 | 9 | set -l fortress_dir |
| 10 | - if set -q FORTRESS_DIR | |
| 11 | - set fortress_dir $FORTRESS_DIR | |
| 10 | + set -l fortress_exe | |
| 11 | + | |
| 12 | + # Check for fortress-bin in PATH first (works for all package managers including Homebrew) | |
| 13 | + if command -v fortress-bin &> /dev/null | |
| 14 | + set fortress_exe fortress-bin | |
| 12 | 15 | else if test -x /usr/bin/fortress-bin |
| 13 | - # Use system-installed binary | |
| 16 | + # Use system-installed binary (RPM/AUR) | |
| 14 | 17 | set fortress_exe /usr/bin/fortress-bin |
| 18 | + else if set -q FORTRESS_DIR | |
| 19 | + set fortress_dir $FORTRESS_DIR | |
| 20 | + set fortress_exe $fortress_dir/build/gfortran_*/app/fortress | |
| 15 | 21 | else |
| 16 | 22 | # Fallback to local development path |
| 17 | 23 | set fortress_dir $HOME/Documents/GithubOrgs/FortranGoingOnForty/fortress |
fortress.shmodified@@ -8,8 +8,11 @@ fortress() { | ||
| 8 | 8 | # Determine which fortress binary to use |
| 9 | 9 | local fortress_exe |
| 10 | 10 | |
| 11 | - if [ -x "/usr/bin/fortress-bin" ]; then | |
| 12 | - # Use system-installed binary (via package manager) | |
| 11 | + # Check for fortress-bin in PATH first (works for all package managers including Homebrew) | |
| 12 | + if command -v fortress-bin &> /dev/null; then | |
| 13 | + fortress_exe="fortress-bin" | |
| 14 | + elif [ -x "/usr/bin/fortress-bin" ]; then | |
| 15 | + # Use system-installed binary (via package manager like RPM/AUR) | |
| 13 | 16 | fortress_exe="/usr/bin/fortress-bin" |
| 14 | 17 | elif [ -n "$FORTRESS_DIR" ]; then |
| 15 | 18 | # Use FORTRESS_DIR if set |