From 88f3181124a6780912175f3690b379fe031dfc6e Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Fri, 22 May 2026 11:23:46 -0400 Subject: [PATCH] installer: split runtime and installer paths in finalizer --- finalize.sh | 4 ++-- install.sh | 2 +- install/helpers/logging.sh | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/finalize.sh b/finalize.sh index 02862518..486cfddf 100644 --- a/finalize.sh +++ b/finalize.sh @@ -10,9 +10,9 @@ set -eEo pipefail _OMARCHY_INSTALLER_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") export OMARCHY_PATH="${OMARCHY_PATH:-$_OMARCHY_INSTALLER_DIR}" -export OMARCHY_INSTALL="$OMARCHY_PATH/install" +export OMARCHY_INSTALL="${OMARCHY_INSTALL:-$_OMARCHY_INSTALLER_DIR/install}" export OMARCHY_INSTALL_LOG_FILE="${OMARCHY_INSTALL_LOG_FILE:-/var/log/omarchy-install.log}" -export PATH="$OMARCHY_PATH/bin:$PATH" +export PATH="$_OMARCHY_INSTALLER_DIR/bin:$OMARCHY_PATH/bin:$PATH" source "$OMARCHY_INSTALL/helpers/mode.sh" detect_install_mode diff --git a/install.sh b/install.sh index cfbaf05a..274784ca 100644 --- a/install.sh +++ b/install.sh @@ -12,7 +12,7 @@ set -eEo pipefail _OMARCHY_INSTALLER_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")") export OMARCHY_PATH="${OMARCHY_PATH:-$_OMARCHY_INSTALLER_DIR}" -export OMARCHY_INSTALL="$OMARCHY_PATH/install" +export OMARCHY_INSTALL="${OMARCHY_INSTALL:-$OMARCHY_PATH/install}" export OMARCHY_INSTALL_LOG_FILE="${OMARCHY_INSTALL_LOG_FILE:-/var/log/omarchy-install.log}" export PATH="$OMARCHY_PATH/bin:$PATH" diff --git a/install/helpers/logging.sh b/install/helpers/logging.sh index 88693657..d215838e 100644 --- a/install/helpers/logging.sh +++ b/install/helpers/logging.sh @@ -118,8 +118,9 @@ run_logged() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >>"$OMARCHY_INSTALL_LOG_FILE" - # Use bash -c to create a clean subshell - bash -c "source '$script'" >"$OMARCHY_INSTALL_LOG_FILE" 2>&1 + # Use a clean subshell, but keep errexit so failures inside sourced scripts + # cannot be hidden by a later successful command in the same script. + bash -eE -c 'source "$1"' bash "$script" >"$OMARCHY_INSTALL_LOG_FILE" 2>&1 local exit_code=$?