fixed: make sure source directory existing

This commit is contained in:
Tjatse 2016-03-25 17:41:38 +08:00
parent 14685c4859
commit b25b497509
1 changed files with 7 additions and 2 deletions

View File

@ -2,8 +2,13 @@
node="$(which node)"
SRC="$0"
DIR="$(cd $(dirname "$0"); pwd)"
REALSRC="$DIR/$(readlink "$SRC")"
SRC="$(cd $(dirname $REALSRC); pwd)"
REALSRC="$(readlink "$SRC")"
if [ ! -z $REALSRC ];
then
SRC="$(cd $(dirname $DIR/$REALSRC); pwd)"
else
SRC="$DIR"
fi
pidfile="$SRC/pm2-gui.pid"
prefixINFO="\033[1;32m[INFO]\033[0m"
prefixWARN="\033[1;33m[WARN]\033[0m"