Created
January 1, 2020 22:49
-
-
Save seanr/7cf3e1e17d00eb1afcbfc5eb30ee73e3 to your computer and use it in GitHub Desktop.
Fish-compatible blt alias/function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function blt | |
if eval [[ ! -z {$AH_SITE_ENVIRONMENT} ]] | |
set PROJECT_ROOT "/var/www/html/{$AH_SITE_GROUP}.{$AH_SITE_ENVIRONMENT}" | |
else if [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; | |
set PROJECT_ROOT "git rev-parse --show-cdup" | |
else | |
set PROJECT_ROOT "." | |
end | |
if [ -f "$PROJECT_ROOT/vendor/bin/blt" ] | |
$PROJECT_ROOT/vendor/bin/blt $argv | |
# Check for local BLT. | |
else if [ -f "./vendor/bin/blt" ] | |
./vendor/bin/blt $argv | |
else | |
echo "You must run this command from within a BLT-generated project." | |
return 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment