@@ -55,25 +55,31 @@ check_and_install_app() {
5555 # some black magic to set the generated app variable (i.e. MVN_BIN) into the
5656 # environment
5757 eval " ${APP_BIN} =` which $1 2> /dev/null` "
58+
59+ # Check and source the package build file if present, else error out
60+ if [ -f " $resource " ]; then
61+ source " ${_DIR} /packages/$1 .sh"
62+ else
63+ echo " ERROR: Cannot find the $1 .sh build file from within ${_DIR} /packages."
64+ echo " Ensure the file exists and is accesible."
65+ exit 1
66+ fi
67+
5868 if [ -z " ` which $1 2> /dev/null` " ]; then
5969 # attempt to force install if flagged
6070 if [ -n " ${FORCE_INSTALL} " ]; then
6171 local resource=" ${_DIR} /packages/$1 .sh"
62- if [ -f " $resource " ]; then
63- source " ${_DIR} /packages/$1 .sh"
72+
6473 prep_install_for_${_OSTYPE}
6574 install_$1 _for_${_OSTYPE}
66- else
67- echo " ERROR: Cannot find the $1 .sh build file from within ${_DIR} /packages."
68- echo " Ensure the file exists and is accesible."
69- exit 1
70- fi
75+
7176 # else exit with error message
7277 else
7378 echo " ERROR: $1 isn't installed; please install or automatically force install (-f)."
7479 exit 2
7580 fi
7681 fi
82+ postprocess_$1 _for_${_OSTYPE}
7783}
7884
7985# Prints the help and usage for this script
@@ -143,16 +149,20 @@ ZINC_PORT=${ZINC_PORT:-"3030"}
143149# Check and install all applications necessary to fully build Spark
144150check_and_install_app " mvn"
145151check_and_install_app " zinc"
152+ check_and_install_app " scala"
146153
147154# Reset the current working directory
148155cd " ${_DIR} /.."
149156
150157# Now that zinc is ensured to be installed, check its status and, if its
151158# not running, start it
152- if [ -z " ` ${ZINC_BIN} -status` " ]; then
153- ${ZINC_BIN} -start -port ${ZINC_PORT}
159+ if [ -n " ` ${ZINC_BIN} -status` " ]; then
160+ ${ZINC_BIN} -shutdown
154161fi
155162
163+ ${ZINC_BIN} -start -port ${ZINC_PORT} -scala-home " ${SCALA_HOME} "
164+ ${ZINC_BIN} -status
165+
156166# Determine the parameters pushed in from the command line and, if any are
157167# present, use those within the maven
158168if [ $# -gt 0 ]; then
0 commit comments