From a154893c9f96a657ce644be4d165e3b259d01863 Mon Sep 17 00:00:00 2001 From: Jack Engqvist Johansson Date: Sat, 21 Apr 2012 14:42:59 +0200 Subject: [PATCH] added help --- deploy.sh | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) mode change 100644 => 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh old mode 100644 new mode 100755 index 57c225a..de70986 --- a/deploy.sh +++ b/deploy.sh @@ -40,22 +40,51 @@ # --------------------------------------------- # Usage: # --------------------------------------------- -# ./deploy begin Run begin script -# ./deploy copy Copy files to /tmp -# ./deploy replace Replace the old files -# ./deploy finish Run the finish script +# To deploy, run: +# ./deploy --install [ .deploy location ] # -# To deploy run: -# ./deploy install +# To update already existing deployment, run: +# ./deploy --update [ .deploy location ] # -# To update already existing deployment run: -# ./deploy update +# It will run copy, replace and update-s2... +# +# Partial deployment options: +# ./deploy --begin Run begin script +# ./deploy --copy Copy files to /tmp +# ./deploy --replace Replace the old files +# ./deploy --finish Run the finish script +# ./deploy --update-s2 Run the update script, only +# +# If the location where the .deploy file isn't specified, deploy.sh will assume +# it's in the current directory. # --------------------------------------------- APP="$0" COMMAND=$1 DIR="$2" +if [ "$1" = "" ]; then + echo " + To deploy, run: + ./deploy --install [ .deploy location ] + + To update already existing deployment, run: + ./deploy --update [ .deploy location ] + + It will run copy, replace and update-s2... + + Partial deployment options: + ./deploy --begin Run begin script + ./deploy --copy Copy files to /tmp + ./deploy --replace Replace the old files + ./deploy --finish Run the finish script + ./deploy --update-s2 Run the update script, only + + If the location where the .deploy file isn't specified, deploy.sh will assume + it's in the current directory." + exit +fi + # clean up the location string if [ "$DIR" = "" ]; then DIR="$( cd "$( dirname "$0" )" && pwd )" @@ -81,6 +110,9 @@ elif [ "$COMMAND" = "--update" ]; then $APP --update-s2 echo "Update is done" exit +elif [ "$COMMAND" = "--help" ]; then + $APP + exit fi # get user info