Files

17 lines
321 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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}"
}