Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash
# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
solaris=false;
freebsd=false;
case "$(uname)" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
SunOS*)
solaris=true
;;
FreeBSD*)
freebsd=true
esac
OFFLINE_BROADCAST=$( cat << EOF
==== BROADCAST =============================================
AEROPLANE MODE ENABLED! Some functionality is now disabled.
============================================================
EOF
)
ONLINE_BROADCAST=$( cat << EOF
==== BROADCAST =============================================
ONLINE MODE RE-ENABLED! All functionality now restored.
============================================================
EOF
)
OFFLINE_MESSAGE="This command is not available in aeroplane mode."
GVM_CANDIDATES=("groovy" "grails" "griffon" "gradle" "lazybones" "vertx")
PATH="${GVM_DIR}/bin:${GVM_DIR}/ext:$PATH"
GROOVY_HOME="${GVM_DIR}/groovy/current"
GRAILS_HOME="${GVM_DIR}/grails/current"
GRIFFON_HOME="${GVM_DIR}/griffon/current"
GRADLE_HOME="${GVM_DIR}/gradle/current"
LAZYBONES_HOME="${GVM_DIR}/lazybones/current"
VERTX_HOME="${GVM_DIR}/vertx/current"
export PATH="${GROOVY_HOME}/bin:${GRAILS_HOME}/bin:${GRIFFON_HOME}/bin:${GRADLE_HOME}/bin:${LAZYBONES_HOME}/bin:${VERTX_HOME}/bin:$PATH"
# Source gvm module scripts.
for f in $(find "${GVM_DIR}/src" -type f -name 'gvm-*'); do
source "${f}"
done
# Source extension files prefixed with 'gvm-' and found in the ext/ folder
# Use this if extensions are written with the functional approach and want
# to use functions in the main gvm script.
for f in $(find "${GVM_DIR}/ext" -type f -name 'gvm-*'); do
if [ -r "${f}" ]; then
source "${f}"
fi
done
unset f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment