Files
deighton-ar/server/ops
John Lyon-Smith 5889f7655a Adding test user
2018-02-28 13:42:02 -08:00

25 lines
537 B
Bash
Executable File

#!/bin/bash
script_dir=$(dirname $0)
script="${script_dir}/src/bin/$1"
if [[ -z "$1" ]]; then
echo "usage: $(basename $0) <command>"
echo ""
echo "Available scripts are"
ls -1 ${script_dir}/src/bin
exit -1
fi
# For scripts that need config access
export NODE_CONFIG_DIR="${script_dir}/config"
if [[ ! -e "${script}" ]]; then
echo error: Script ${script} does not exist
exit -1
fi
shift
# See https://stackoverflow.com/questions/448407/bash-script-to-receive-and-repass-quoted-parameters
babel-node -- "${script}" "$@"