diff --git a/train.sh b/train.sh index 95ab942a..76a57271 100755 --- a/train.sh +++ b/train.sh @@ -60,15 +60,22 @@ if [ -z "${ENV}" ]; then fi fi +if [ -z "${CONFIG_BACKEND}" ]; then + if [ -n "${CONFIG_TYPE}" ]; then + export CONFIG_BACKEND="${CONFIG_TYPE}" + fi +fi + if [ -z "${CONFIG_BACKEND}" ]; then export CONFIG_BACKEND="env" export CONFIG_PATH="config/${ENV_PATH}config" - if [ -f "${CONFIG_PATH}.env" ]; then - export CONFIG_BACKEND="env" elif [ -f "${CONFIG_PATH}.json" ]; then + if [ -f "${CONFIG_PATH}.json" ]; then export CONFIG_BACKEND="json" elif [ -f "${CONFIG_PATH}.toml" ]; then export CONFIG_BACKEND="toml" + elif [ -f "${CONFIG_PATH}.env" ]; then + export CONFIG_BACKEND="env" fi echo "Using ${CONFIG_BACKEND} backend: ${CONFIG_PATH}.${CONFIG_BACKEND}" fi