Skip to content

Instantly share code, notes, and snippets.

@seanr
Created January 1, 2020 22:49
Show Gist options
  • Save seanr/7cf3e1e17d00eb1afcbfc5eb30ee73e3 to your computer and use it in GitHub Desktop.
Save seanr/7cf3e1e17d00eb1afcbfc5eb30ee73e3 to your computer and use it in GitHub Desktop.
Fish-compatible blt alias/function
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