add installation script
[mTask.git] / install_clean.sh
1 #!/bin/sh
2 set -e
3 if [ "$#" -eq 0 ];
4 then
5 echo "Usage: $0 DIR" >&2
6 exit 1;
7 fi
8 TARGET="$(realpath "$1")"
9 echo "Installing to $TARGET"
10 rm -fr "$TARGET"
11 mkdir -p "$TARGET"
12 curl -sSL ftp://ftp.cs.ru.nl/pub/Clean/builds/linux-x64/clean-bundle-complete-linux-x64-latest.tgz \
13 | gunzip | tar --strip-components=1 --extract --directory="$TARGET"
14
15 if [ "$CLEAN_HOME" != "$TARGET" ]; then
16 echo "Add or change \$CLEAN_HOME to \"$TARGET\""
17 fi
18 if ! hash clm; then
19 if [ "$(which clm)" != "$TARGET/bin" ]; then
20 echo "Replace the old clm path with \$CLEAN_HOME/bin in PATH"
21 else
22 echo "Add \$CLEAN_HOME/bin to your PATH"
23 fi
24 fi
25 echo "Done"