#!/usr/bin/env bash set -euo pipefail if [ "$#" -lt 1 ]; then echo "Usage: bash run.sh /path/to/config" exit 1 fi SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CONFIG_DIR="$1" # 相对路径转换为绝对路径 if [[ "$CONFIG_DIR" != /* ]]; then CONFIG_DIR="$(cd "$CONFIG_DIR" && pwd)" fi export ConfigDir="$CONFIG_DIR" cd "$SCRIPT_DIR" exec python main.py