2024-12-30 20:50:06 +00:00
|
|
|
#!/usr/bin/env bash
|
2025-01-04 11:35:21 +00:00
|
|
|
# shellcheck disable=SC2086
|
2024-12-30 20:50:06 +00:00
|
|
|
|
2025-01-04 11:35:21 +00:00
|
|
|
# Ensure /config/tmp exists and set correct permissions
|
2025-01-04 11:05:37 +00:00
|
|
|
if [[ ! -d /config/tmp ]]; then
|
|
|
|
mkdir -p /config/tmp
|
|
|
|
chmod 1777 /config/tmp
|
|
|
|
fi
|
|
|
|
|
2025-01-04 11:35:21 +00:00
|
|
|
# Ensure /config/.cache/uv exists
|
|
|
|
if [[ ! -d /config/.cache/uv ]]; then
|
|
|
|
mkdir -p /config/.cache/uv
|
|
|
|
chmod -R 775 /config/.cache/uv
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Export necessary environment variables
|
2025-01-04 11:05:37 +00:00
|
|
|
export TMPDIR="/config/tmp"
|
2025-01-04 11:35:21 +00:00
|
|
|
export UV_CACHE_DIR="/config/.cache/uv"
|
2025-01-04 11:36:51 +00:00
|
|
|
export UV_SYSTEM_PYTHON="false"
|
|
|
|
export PYTHONPATH="/config/deps:/usr/local/lib/python3.13/site-packages:$PYTHONPATH"
|
|
|
|
export PIP_TARGET="/config/deps"
|
2025-01-04 11:05:37 +00:00
|
|
|
|
|
|
|
# Ensure HACS installation if requested
|
2024-12-30 20:50:06 +00:00
|
|
|
if [[ "${HOME_ASSISTANT__HACS_INSTALL}" == "true" ]]; then
|
|
|
|
curl -sfSL https://get.hacs.xyz | bash -
|
|
|
|
fi
|
|
|
|
|
2025-01-04 11:05:37 +00:00
|
|
|
# Execute Home Assistant with the provided arguments
|
2024-12-30 20:50:06 +00:00
|
|
|
exec \
|
|
|
|
/usr/local/bin/hass \
|
|
|
|
--config /config \
|
2025-01-04 11:05:37 +00:00
|
|
|
"$@"
|