aboutsummaryrefslogtreecommitdiff
path: root/sbt/sbt-launch-lib.bash
diff options
context:
space:
mode:
authorPrashant Sharma <prashant.s@imaginea.com>2014-09-08 10:24:15 -0700
committerAndrew Or <andrewor14@gmail.com>2014-09-08 10:24:15 -0700
commite16a8e7db5a3b1065b14baf89cb723a59b99226b (patch)
tree09d5b9bd510325047aa20f62f215184e46367bdb /sbt/sbt-launch-lib.bash
parent711356b422c66e2a80377a9f43fce97282460520 (diff)
downloadspark-e16a8e7db5a3b1065b14baf89cb723a59b99226b.tar.gz
spark-e16a8e7db5a3b1065b14baf89cb723a59b99226b.tar.bz2
spark-e16a8e7db5a3b1065b14baf89cb723a59b99226b.zip
SPARK-3337 Paranoid quoting in shell to allow install dirs with spaces within.
... Tested ! TBH, it isn't a great idea to have directory with spaces within. Because emacs doesn't like it then hadoop doesn't like it. and so on... Author: Prashant Sharma <prashant.s@imaginea.com> Closes #2229 from ScrapCodes/SPARK-3337/quoting-shell-scripts and squashes the following commits: d4ad660 [Prashant Sharma] SPARK-3337 Paranoid quoting in shell to allow install dirs with spaces within.
Diffstat (limited to 'sbt/sbt-launch-lib.bash')
-rwxr-xr-xsbt/sbt-launch-lib.bash12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbt/sbt-launch-lib.bash b/sbt/sbt-launch-lib.bash
index fecc3d38a5..7f05d2ef49 100755
--- a/sbt/sbt-launch-lib.bash
+++ b/sbt/sbt-launch-lib.bash
@@ -7,7 +7,7 @@
# TODO - Should we merge the main SBT script with this library?
if test -z "$HOME"; then
- declare -r script_dir="$(dirname $script_path)"
+ declare -r script_dir="$(dirname "$script_path")"
else
declare -r script_dir="$HOME/.sbt"
fi
@@ -46,20 +46,20 @@ acquire_sbt_jar () {
if [[ ! -f "$sbt_jar" ]]; then
# Download sbt launch jar if it hasn't been downloaded yet
- if [ ! -f ${JAR} ]; then
+ if [ ! -f "${JAR}" ]; then
# Download
printf "Attempting to fetch sbt\n"
- JAR_DL=${JAR}.part
+ JAR_DL="${JAR}.part"
if hash curl 2>/dev/null; then
- (curl --silent ${URL1} > ${JAR_DL} || curl --silent ${URL2} > ${JAR_DL}) && mv ${JAR_DL} ${JAR}
+ (curl --silent ${URL1} > "${JAR_DL}" || curl --silent ${URL2} > "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
elif hash wget 2>/dev/null; then
- (wget --quiet ${URL1} -O ${JAR_DL} || wget --quiet ${URL2} -O ${JAR_DL}) && mv ${JAR_DL} ${JAR}
+ (wget --quiet ${URL1} -O "${JAR_DL}" || wget --quiet ${URL2} -O "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
else
printf "You do not have curl or wget installed, please install sbt manually from http://www.scala-sbt.org/\n"
exit -1
fi
fi
- if [ ! -f ${JAR} ]; then
+ if [ ! -f "${JAR}" ]; then
# We failed to download
printf "Our attempt to download sbt locally to ${JAR} failed. Please install sbt manually from http://www.scala-sbt.org/\n"
exit -1