Files
crypto_monitor/manual_trading_hub/scripts/lib_load_dotenv.sh
T
dekun b733e551a0 Normalize fullwidth punctuation to ASCII across codebase.
Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 23:42:26 +08:00

17 lines
315 B
Bash

# shellcheck shell=bash
# 供 run_agent.sh / run_hub.sh source:加载 .env 并去掉 Windows CRLF($'\r')
load_dotenv_file() {
local f="$1"
if [[ ! -f "${f}" ]]; then
return 1
fi
set -a
set +e
# shellcheck disable=SC1090
. <(sed 's/\r$//' "${f}")
local rc=$?
set -e
set +a
return "${rc}"
}