Pattern for test sourcing the script
Contents
# Test if it is sourced or not
if [[ $0 != .*bash ]]; then
echo Please source it: . $0
exit 1
fi
res=`gradle --version >/dev/null 2>&1; echo $? `
if [[ $res == "0" ]]; then
echo Have gradle: `which gradle`
gradle --version
else
export GRADLE_HOME=~/opt/gradle
export PATH=$PATH:$GRADLE_HOME/bin
echo No Gradle, adding - `which gradle`
gradle --version
fi
Author Miro Adamy
LastMod 2013-04-09
License (c) 2006-2020 Miro Adamy