diff options
Diffstat (limited to 'bin/spark-config.sh')
-rwxr-xr-x | bin/spark-config.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/spark-config.sh b/bin/spark-config.sh new file mode 100755 index 0000000000..d4b6558866 --- /dev/null +++ b/bin/spark-config.sh @@ -0,0 +1,19 @@ +# included in all the spark scripts with source command +# should not be executable directly +# also should not be passed any arguments, since we need original $* + +# resolve links - $0 may be a softlink +this="${BASH_SOURCE-$0}" +common_bin=$(cd -P -- "$(dirname -- "$this")" && pwd -P) +script="$(basename -- "$this")" +this="$common_bin/$script" + +# convert relative path to absolute path +config_bin=`dirname "$this"` +script=`basename "$this"` +config_bin=`cd "$config_bin"; pwd` +this="$config_bin/$script" + +export SPARK_PREFIX=`dirname "$this"`/.. +export SPARK_HOME=${SPARK_PREFIX} +export SPARK_CONF_DIR="$SPARK_HOME/conf"
\ No newline at end of file |