From b25b4975099c54433ff24583c047d9ed1dc08710 Mon Sep 17 00:00:00 2001 From: Tjatse Date: Fri, 25 Mar 2016 17:41:38 +0800 Subject: [PATCH] fixed: make sure source directory existing --- pm2-gui | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pm2-gui b/pm2-gui index 58023d1..0a9e952 100755 --- a/pm2-gui +++ b/pm2-gui @@ -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"