17 lines
321 B
Bash
17 lines
321 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}"
|
||
}
|