From 5c275c6309bf2217c5544c95b62b679c69c1e03d Mon Sep 17 00:00:00 2001 From: Uri Laserson Date: Thu, 8 Oct 2015 12:30:33 -0700 Subject: [PATCH] [ADAM-857] Corrected handling of env vars in bin scripts Because of `set -e`, the `which spark-submit` subshell command was causing the script to exit early. Fixes #857. --- bin/adam-shell | 2 +- bin/adam-submit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/adam-shell b/bin/adam-shell index 79f127f4ff..c6eb41b2d2 100755 --- a/bin/adam-shell +++ b/bin/adam-shell @@ -56,7 +56,7 @@ NEW_OPTIONS=$("$SCRIPT_DIR"/bin/append_to_option.py , --jars "$ADAM_CLI_JAR" "$@ echo "$NEW_OPTIONS" if [ -z "$SPARK_HOME" ]; then - SPARK_SHELL=$(which spark-shell) + SPARK_SHELL=$(which spark-shell || echo) else SPARK_SHELL="$SPARK_HOME"/bin/spark-shell fi diff --git a/bin/adam-submit b/bin/adam-submit index 3f323d2bba..b93b96bf79 100755 --- a/bin/adam-submit +++ b/bin/adam-submit @@ -84,7 +84,7 @@ echo "Using ADAM_MAIN=$ADAM_MAIN" # Find spark-submit script if [ -z "$SPARK_HOME" ]; then - SPARK_SUBMIT=$(which spark-submit) + SPARK_SUBMIT=$(which spark-submit || echo) else SPARK_SUBMIT="$SPARK_HOME"/bin/spark-submit fi