diff options
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 " |