|
| 1 | +# Git Bash / MINGW64 Compatibility |
| 2 | + |
| 3 | +## Problem |
| 4 | + |
| 5 | +When using Git Bash, MINGW64, or other bash terminals, you get: |
| 6 | + |
| 7 | +```bash |
| 8 | +$ phat |
| 9 | +bash: phat: command not found |
| 10 | +``` |
| 11 | + |
| 12 | +## Cause |
| 13 | + |
| 14 | +Phat uses `.bat` (batch) files which only work in Windows Command Prompt and PowerShell. Bash terminals on Windows don't recognize `.bat` files as executable commands. |
| 15 | + |
| 16 | +## Solutions |
| 17 | + |
| 18 | +### Solution 1: Use PowerShell or CMD (Recommended) |
| 19 | + |
| 20 | +Simply switch to PowerShell or Command Prompt to run Phat: |
| 21 | + |
| 22 | +- **PowerShell**: Press `Win + X` and select "Windows PowerShell" or "Terminal" |
| 23 | +- **CMD**: Press `Win + R`, type `cmd`, and press Enter |
| 24 | + |
| 25 | +Then run your `phat` commands normally. |
| 26 | + |
| 27 | +### Solution 2: Create a Bash Alias |
| 28 | + |
| 29 | +Add this to your `~/.bashrc` or `~/.bash_profile`: |
| 30 | + |
| 31 | +```bash |
| 32 | +# Phat alias for Git Bash |
| 33 | +phat() { |
| 34 | + powershell.exe -ExecutionPolicy Bypass -File "C:/Program Files (x86)/Phat/phat.ps1" "$@" |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +**Note**: Adjust the path if Phat is installed elsewhere. Use forward slashes (`/`) instead of backslashes. |
| 39 | + |
| 40 | +After adding the alias: |
| 41 | +1. Restart your bash terminal, or |
| 42 | +2. Run: `source ~/.bashrc` |
| 43 | + |
| 44 | +Now you can use `phat` commands in Git Bash. |
| 45 | + |
| 46 | +### Solution 3: Run via PowerShell Command |
| 47 | + |
| 48 | +You can run Phat directly from bash using PowerShell: |
| 49 | + |
| 50 | +```bash |
| 51 | +powershell.exe -ExecutionPolicy Bypass -File "C:/Program Files (x86)/Phat/phat.ps1" list |
| 52 | +``` |
| 53 | + |
| 54 | +### Solution 4: Add PowerShell Function to PATH |
| 55 | + |
| 56 | +Create a bash function wrapper. Add to `~/.bashrc`: |
| 57 | + |
| 58 | +```bash |
| 59 | +export PHAT_HOME="/c/Program Files (x86)/Phat" |
| 60 | +alias phat='powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$PHAT_HOME/phat.ps1"' |
| 61 | +``` |
| 62 | + |
| 63 | +## Important Notes for Bash Users |
| 64 | + |
| 65 | +- Phat is designed for Windows environments (PowerShell/CMD) |
| 66 | +- It manages XAMPP which is a Windows application |
| 67 | +- For the best experience, use PowerShell or CMD when working with Phat |
| 68 | + |
| 69 | +## Testing Your Setup |
| 70 | + |
| 71 | +After configuring, test with: |
| 72 | + |
| 73 | +```bash |
| 74 | +phat --version |
| 75 | +``` |
| 76 | + |
| 77 | +## Related Resources |
| 78 | + |
| 79 | +- [Bash Aliases Guide](https://www.gnu.org/software/bash/manual/html_node/Aliases.html) |
| 80 | +- [Back to Troubleshooting Index](TROUBLESHOOTING.md) |
0 commit comments