Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/distro.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/install.sh b/install.sh
index 5ea1ad9..40fb6a9 100755
--- a/install.sh
+++ b/install.sh
@@ -4,6 +4,11 @@ SKIP_RC=0
BATCH_INSTALL=0
THIS_DIR=$(cd $(dirname $0); pwd)
+if [[ "$THIS_DIR" == *" "* ]]; then
+ echo "$THIS_DIR: Torch cannot install to a path containing whitespace.
+Please try a different path, one without any spaces."
+ exit 1
+fi
PREFIX=${PREFIX:-"${THIS_DIR}/install"}
TORCH_LUA_VERSION=${TORCH_LUA_VERSION:-"LUAJIT21"} # by default install LUAJIT21
@@ -187,7 +192,7 @@ fi
WRITE_PATH_TO_PROFILE=0
if [[ $BATCH_INSTALL == 0 ]]; then
- if [ -f $RC_FILE ]; then
+ if [ -f "$RC_FILE" ]; then
echo "
Do you want to automatically prepend the Torch install location
@@ -210,7 +215,7 @@ to PATH and LD_LIBRARY_PATH in your $RC_FILE? (yes/no)
fi
fi
else
- if [[ $RC_FILE ]]; then
+ if [[ "$RC_FILE" ]]; then
WRITE_PATH_TO_PROFILE=1
fi
fi
@@ -218,10 +223,10 @@ fi
if [[ $WRITE_PATH_TO_PROFILE == 1 ]]; then
echo "
-. $PREFIX/bin/torch-activate" >> $RC_FILE
+. $PREFIX/bin/torch-activate" >> "$RC_FILE"
echo "
-. $PREFIX/bin/torch-activate" >> $HOME/.profile
+. $PREFIX/bin/torch-activate" >> "$HOME"/.profile
else
echo "