Skip to content

Instantly share code, notes, and snippets.

@nikunjkotecha
Created August 23, 2022 05:51
Show Gist options
  • Save nikunjkotecha/bc36569f508a5bc8764e6f7612c0d928 to your computer and use it in GitHub Desktop.
Save nikunjkotecha/bc36569f508a5bc8764e6f7612c0d928 to your computer and use it in GitHub Desktop.
function blt() {
if [[ ! -z ${AH_SITE_ENVIRONMENT} ]]; then
PROJECT_ROOT="/var/www/html/${AH_SITE_GROUP}.${AH_SITE_ENVIRONMENT}"
elif [ "`git rev-parse --show-cdup 2> /dev/null`" != "" ]; then
PROJECT_ROOT=$(git rev-parse --show-cdup)
else
PROJECT_ROOT="."
fi
if [ -f "$PROJECT_ROOT/vendor/bin/blt" ]; then
$PROJECT_ROOT/vendor/bin/blt "$@"
# Check for local BLT.
elif [ -f "./vendor/bin/blt" ]; then
./vendor/bin/blt "$@"
else
echo "You must run this command from within a BLT-generated project."
return 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment