better serial integration, moved things outside
[mTask.git] / install_clean.sh
index e21a1c6..569cc65 100755 (executable)
@@ -7,11 +7,11 @@ then
 fi
 TARGET="$(realpath "$1")"
 if [ -d "$TARGET" ]; then
-       mv "$TARGET" "$TARGET.$(date +%F)"
+       mv "$TARGET" "$TARGET.$(date +%F)" || rm -fr "$TARGET"
 fi
 rm -fr "$TARGET"
 mkdir -p "$TARGET"
 curl -sSL ftp://ftp.cs.ru.nl/pub/Clean/builds/linux-x64/clean-bundle-complete-linux-x64-latest.tgz \
-       | gunzip | tar --strip-components=1 --extract --directory="$TARGET"
+       | tar --gunzip --strip-components=1 --extract --directory="$TARGET"
 
 echo "export CLEAN_HOME=$TARGET; export PATH=$TARGET/bin:\$PATH;"