fix: blitz-run-context.service 失败

This commit is contained in:
2026-04-14 21:13:27 +08:00
parent e895cdc9de
commit 1c2cf157d2
7 changed files with 37 additions and 2 deletions

View File

@@ -9,6 +9,23 @@ die() {
return 1 2>/dev/null || exit 1
}
normalize_loaded_env_vars() {
local var_name
local value
for var_name in $(compgen -A variable); do
case "${var_name}" in
BACKEND_*|BLITZ_*|B_SIDE_*|CONTROL_*|FRONTEND_*|OMNI_*|PYTHON3_BIN|PYTHON_VENV_PATH|ROBOT_*|ROS_DISTRO|VITE_*)
value="${!var_name}"
if [[ "${value}" == *$'\r' ]]; then
printf -v "${var_name}" '%s' "${value%$'\r'}"
export "${var_name}"
fi
;;
esac
done
}
is_omnisocketgo_root() {
local dir="$1"
[[ -f "${dir}/Makefile" && -f "${dir}/cmd/b_side_omnid.c" && -d "${dir}/ros-control-py" ]]
@@ -68,6 +85,8 @@ for env_file in "${ENV_FILES[@]}"; do
fi
done
normalize_loaded_env_vars
if [[ "${omni_camera_device_was_set}" == "1" ]]; then
export OMNI_CAMERA_DEVICE="${preserved_omni_camera_device}"
fi