I have a Powershell profile set up with this alias:
New-Alias dev C:\websites\dev\bin\dev.sh -Scope Global
from the Powershell this works fine. dev.sh
is actually a binary (the .sh will come off, on for other reasons) that sets some env variables and runs commands.
I have a shell script that looks like this:
#!/bin/sh
dev rebuild
dev exec identity php artisan migrate:fresh
dev exec identity php artisan db:seed --class=DemoSeeder
dev exec matching php artisan migrate:fresh --seed
dev exec matching php artisan db:seed --class=DemoSeeder
This fails with bash: dev: command not found
I don't think this is any sort of exporting alias problem, since it works fine from the Powershell cli, but rather that the shell script can't read the alias. Possible solutions seem to prefer that I modify a .bashrc to set the alias, or to try to set it inside the script itself, but I don't think either of these will be very good to work across a team with different operating systems & repo locations
How can I get the .sh script to read the dev
alias?