From: Silvio Rhatto Date: Fri, 17 Nov 2017 12:36:43 +0000 (-0200) Subject: Trashman install detects if it is running the system-wide version X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=b28a6ee5f6de51085dcf3be943a87cc674fadfe0;p=trashman.git Trashman install detects if it is running the system-wide version --- diff --git a/share/trashman/trashman/unix/install b/share/trashman/trashman/unix/install index 289a653..db2206c 100755 --- a/share/trashman/trashman/unix/install +++ b/share/trashman/trashman/unix/install @@ -17,8 +17,14 @@ if ! which rsync > /dev/null 2>&1; then exit 1 fi -# Install -rsync -av --delete $BASE/ $FOLDER/share/trashman/ || exit 1 +# Ensure folders exists and we have their absolute names +FOLDER="`mkdir -p $FOLDER && cd $FOLDER > /dev/null && pwd`" +BASE="`cd $BASE > /dev/null && pwd`" + +# Install if we're not already running the system-wide version +if [ "$BASE" != "$FOLDER" ]; then + rsync -av --delete $BASE/ $FOLDER/share/trashman/ || exit 1 +fi # Create symlink ( cd $FOLDER/bin && ln -sf $FOLDER/share/trashman/trashman ) || exit 1