run.sh (448B) [raw]
1 #!/bin/sh 2 # start the app 3 set -e 4 die() { 5 echo "$1" 1>&2 6 exit 1 7 } 8 9 depends() { 10 if ! command -v "$1" >/dev/null; then 11 die "'$1' not found. See README.md for install instructions" 12 fi 13 } 14 15 depends mojo 16 17 # Need to move to top-level. Otherwise, the webpack runs a npm install 18 # each time the server is started... 19 DIR=`dirname $0` 20 cd $DIR 21 22 if [ -n "$DEBUG" ]; then 23 exec ./gloat.pl daemon 24 else 25 exec mojo webpack ./gloat.pl 26 fi