]> git.sev.monster Git - dotfiles.git/blobdiff - install.sh
install.sh: fix cd test print
[dotfiles.git] / install.sh
index fbe8f1f0762cdab640145d5afa701d0adba16362..88a80ad20bcdae5aea6372bc6728862bfeb64140 100755 (executable)
@@ -19,11 +19,11 @@ cache="${XDG_CACHE_HOME#$DEST/}"
 
 # test
 devnull=/dev/null
-if [ "$1" = "test" ]; then
+if [ ${DOTFILES_TEST+x} = x ]; then
     echo "Running test -- no changes will be applied"
     devnull=/dev/stdout
     _cd() {
-        echo "-- cd $* --> $PWD";
+        echo "-- cd $PWD --> $*";
         cd $*;
     }
     alias cd="_cd"
@@ -69,7 +69,7 @@ find . "$share" "$etc" \
      -xdev -mindepth 1 -maxdepth 1 -type l -exec sh -c '
        r="$(realpath "{}")"
        [ "${r#'"$SRC"'/}" != "$r" ] &&
-         '"$([ "$1" = test ] && echo 'echo +++ ')"'unlink "{}"' \;
+         '"$([ ${DOTFILES_TEST+x} = x ] && echo 'echo +++ ')"'unlink "{}"' \;
 
 cd "$SRC" >$devnull
 
This page took 0.029625 seconds and 4 git commands to generate.