Ensure HOME directory exists before export

This commit is contained in:
Alexandre
2026-01-11 08:49:57 +01:00
parent 4e16f8da5c
commit 3d604d4809
2 changed files with 10 additions and 4 deletions

View File

@@ -205,7 +205,10 @@ while IFS= read -r line; do
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
# Persist for interactive shells
append_unique_line "$HOME/.bashrc" "export $line"
if [[ -n "${HOME:-}" ]]; then
mkdir -p "$HOME"
append_unique_line "$HOME/.bashrc" "export $line"
fi
append_unique_line "/etc/bash.bashrc" "export $line"
# Show in log