From 7ec801a9268e7494d87e3140febd0dbb9ed5efd5 Mon Sep 17 00:00:00 2001 From: Jesse Yang Date: Wed, 5 Mar 2014 23:16:09 +0800 Subject: [PATCH] a more generic run script --- tools/run.sh | 14 ++++++++++++++ tools/toplist.sh | 7 ------- 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100755 tools/run.sh delete mode 100755 tools/toplist.sh 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