mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-05 15:15:58 +02:00
Ensure HOME directory exists before export
This commit is contained in:
@@ -301,11 +301,14 @@ done
|
|||||||
update_scripts_with_block
|
update_scripts_with_block
|
||||||
|
|
||||||
# --- MINIMAL CHANGE: also inject into /etc/bash.bashrc (for interactive bash shells)
|
# --- MINIMAL CHANGE: also inject into /etc/bash.bashrc (for interactive bash shells)
|
||||||
mkdir -p /etc "$HOME"
|
mkdir -p /etc
|
||||||
touch "/etc/bash.bashrc"
|
touch "/etc/bash.bashrc"
|
||||||
touch "$HOME/bash.bashrc"
|
|
||||||
inject_block_into_file "/etc/bash.bashrc"
|
inject_block_into_file "/etc/bash.bashrc"
|
||||||
inject_block_into_file "$HOME/bash.bashrc"
|
if [[ -n "${HOME:-}" ]]; then
|
||||||
|
mkdir -p "$HOME"
|
||||||
|
touch "$HOME/bash.bashrc"
|
||||||
|
inject_block_into_file "$HOME/bash.bashrc"
|
||||||
|
fi
|
||||||
|
|
||||||
################
|
################
|
||||||
# Set timezone #
|
# Set timezone #
|
||||||
|
|||||||
@@ -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
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
|
||||||
|
|
||||||
# Persist for interactive shells
|
# 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"
|
append_unique_line "/etc/bash.bashrc" "export $line"
|
||||||
|
|
||||||
# Show in log
|
# Show in log
|
||||||
|
|||||||
Reference in New Issue
Block a user