Skip to content

Commit

Permalink
devdeps: shellcheck stop-server.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
zytzagoo committed Nov 25, 2020
1 parent 6a4873c commit efdecbe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/stop-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ if [[ $# -eq 0 ]] ; then
fi

stop_server () {
if [ -e $1 ]; then
PID=$(cat $1);
echo PID=$PID;
if [ -e "$1" ]; then
PID=$(cat "$1");
echo PID="$PID";
# Killing juts the PID is not enough sometimes, nodejs server still lingers on (at least on Windows)
if [ ! -z "$PID" ]; then
kill $PID || true;
if [ -n "$PID" ]; then
kill "$PID" || true;
fi;
rm -rf $1 || true;
rm -rf "$1" || true;
fi;
}

Expand Down

0 comments on commit efdecbe

Please sign in to comment.