15 lines
581 B
Bash
15 lines
581 B
Bash
#!/usr/bin/env bash
|
|
# Validate the TraderX config before starting the server. Exits non-zero on errors.
|
|
# Usage: scripts/prestart-check.sh /path/to/profiles/TraderX [source.yaml] [compat.json]
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "$0")/.." && pwd)"
|
|
PROFILE="${1:?TraderX profile folder required}"
|
|
SRC="${2:-}"
|
|
COMPAT="${3:-}"
|
|
|
|
if [[ -n "$SRC" ]]; then
|
|
args=(check "$SRC")
|
|
[[ -n "$COMPAT" ]] && args+=(--compat "$COMPAT")
|
|
python3 "$HERE/traderx_build.py" "${args[@]}"
|
|
fi
|
|
python3 "$HERE/traderx_check.py" "$PROFILE" --ignore "coefficient" --ignore "not listed" --quiet-info
|