25 lines
537 B
Bash
Executable File
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}" "$@"
|