refactoors
[mTask.git] / install_clean.sh
index 8d877a9..bcedd34 100755 (executable)
@@ -6,20 +6,16 @@ then
        exit 1;
 fi
 TARGET="$(realpath "$1")"
-echo "Installing to $TARGET"
+
+echo "Removing and repopulating $TARGET" >&2
+if [ -d "$TARGET" ]; then
+       mv "$TARGET" "$TARGET.$(date +%F)" || rm -fr "$TARGET"
+fi
 rm -fr "$TARGET"
 mkdir -p "$TARGET"
+
+echo "Downloading and installing clean nightly" >&2
 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 --verbose --gunzip --strip-components=1 --extract --directory="$TARGET"
 
-if [ "$CLEAN_HOME" != "$TARGET" ]; then
-       echo "Add or change \$CLEAN_HOME to \"$TARGET\""
-fi
-if ! hash clm; then
-       if [ "$(which clm)" != "$TARGET/bin" ]; then
-               echo "Replace the old clm path with \$CLEAN_HOME/bin in PATH"
-       else
-               echo "Add \$CLEAN_HOME/bin to your PATH"
-       fi
-fi
-echo "Done"
+echo "export CLEAN_HOME=$TARGET; export PATH=$TARGET/bin:\$PATH;"