diff --git a/template/build/core/phing/tasks/blt.xml b/template/build/core/phing/tasks/blt.xml index 05cb9f6ef..72f82e246 100644 --- a/template/build/core/phing/tasks/blt.xml +++ b/template/build/core/phing/tasks/blt.xml @@ -10,12 +10,8 @@ - - BLT can automatically create a Bash alias to make it easier to run BLT tasks. - This alias may be created in .bash_profile or .bashrc depending on your system architecture. - - + diff --git a/template/scripts/blt/install-alias.sh b/template/scripts/blt/install-alias.sh index f09dcd378..4ba556574 100755 --- a/template/scripts/blt/install-alias.sh +++ b/template/scripts/blt/install-alias.sh @@ -15,14 +15,27 @@ if [ ! -z "$DETECTED_PROFILE" ]; then echo "Alias for blt already exists in $DETECTED_PROFILE" exit fi - DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - if cat $DIR/alias >> $DETECTED_PROFILE; then - echo "Added alias for blt to $DETECTED_PROFILE" - echo "Restart your terminal session to use the new command." - else - echo "Error: Could not modify $DETECTED_PROFILE." + echo "BLT can automatically create a Bash alias to make it easier to run BLT tasks." + echo "This alias may be created in .bash_profile or .bashrc depending on your system architecture." + echo "" + read -p "Install alias? (y/n)" -n 1 -r + echo "" + + if [[ $REPLY =~ ^[Yy]$ ]]; then + DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + + if cat $DIR/alias >> $DETECTED_PROFILE; then + echo "Added alias for blt to $DETECTED_PROFILE" + echo "You may now use the 'blt' command from anywhere within a BLT-generated repository." + echo "" + echo "Restart your terminal session to use the new command." + else + echo "Error: Could not modify $DETECTED_PROFILE." + fi + fi + else echo "Could not install blt alias. No profile found. Tried ~/.zshrc, ~/.bashrc, ~/.bash_profile and ~/.profile." fi