diff --git a/tools/run.sh b/tools/run.sh new file mode 100755 index 0000000..6c42dba --- /dev/null +++ b/tools/run.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +export NODE_ENV=${2:-'development'} +export DEBUG='dbj:*' + +if [[ -z $1 ]]; then + echo + echo 'Must provide a script name to run.' + echo + exit 1 +fi + +# make sure we are at app root +cd `dirname $0`/../ +node "tools/${1}.js" diff --git a/tools/toplist.sh b/tools/toplist.sh deleted file mode 100755 index 83070c3..0000000 --- a/tools/toplist.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -export NODE_ENV='production' -export DEBUG='dbj:*' - -cd /srv/user/douban/doubanj/ -/usr/local/bin/node tools/toplist.js