diff --git a/server/ops b/server/ops index 2bba30e..29071c2 100755 --- a/server/ops +++ b/server/ops @@ -1,9 +1,21 @@ #!/bin/bash + +if [[ "$1" == "--test" ]]; then + export NODE_APP_INSTANCE=test + shift +fi + +if [[ "$1" == "--dev" ]]; then + export NODE_ENV=development +else + export NODE_ENV=production +fi + script_dir=$(dirname $0) script="${script_dir}/dist/bin/${1}.js" if [[ -z "$1" ]]; then - echo "usage: $(basename $0) " + echo "usage: $(basename $0)[--test] [--dev] " echo "" echo "Available commands are" echo "" @@ -13,7 +25,6 @@ fi # For scripts that need config access export NODE_CONFIG_DIR="${script_dir}/config" -export NODE_ENV=production if [[ ! -e "${script}" ]]; then echo error: Script ${script} does not exist