From 4ab33779507bacbb474cfe608b2ee3269c4e4c81 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 29 Jun 2026 11:18:33 -0500 Subject: [PATCH] Drop OMARCHY_PATH fallback and conf reading in channel detection --- bin/omarchy-channel-current | 10 +--------- test/shell.d/channel-test.sh | 16 +++++----------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/bin/omarchy-channel-current b/bin/omarchy-channel-current index 27f25bcb..f6f57f71 100755 --- a/bin/omarchy-channel-current +++ b/bin/omarchy-channel-current @@ -4,18 +4,10 @@ set -euo pipefail -conf=${OMARCHY_CONFIG_FILE:-/etc/omarchy.conf} -omarchy_path=${OMARCHY_PATH:-/usr/share/omarchy} - -if [[ -r $conf ]]; then - configured_path=$(bash -c 'source "$1"; printf "%s\n" "${OMARCHY_PATH:-}"' bash "$conf" 2>/dev/null || true) - [[ -n $configured_path ]] && omarchy_path="$configured_path" -fi - # Dev is a linked source checkout: OMARCHY_PATH points somewhere other than # the package-backed install at /usr/share/omarchy. This takes precedence over # the package channels, since the checkout overrides whatever is installed. -if [[ $omarchy_path != "/usr/share/omarchy" ]]; then +if [[ $OMARCHY_PATH != "/usr/share/omarchy" ]]; then echo dev exit 0 fi diff --git a/test/shell.d/channel-test.sh b/test/shell.d/channel-test.sh index 644265d8..ce0d1242 100644 --- a/test/shell.d/channel-test.sh +++ b/test/shell.d/channel-test.sh @@ -167,25 +167,19 @@ pass "dev refuses occupied non-checkout paths before package changes" current_channel() { OMARCHY_TEST_VERSION_CHANNEL="$1" \ OMARCHY_TEST_PACKAGES="$2" \ - OMARCHY_CONFIG_FILE="${3:-/dev/null}" \ - OMARCHY_PATH="${4:-/usr/share/omarchy}" \ + OMARCHY_PATH="$3" \ PATH="$stub_bin:$ROOT/bin:$PATH" \ "$ROOT/bin/omarchy-channel-current" } -[[ $(current_channel stable stable) == "stable" ]] || fail "current channel detects stable" +[[ $(current_channel stable stable /usr/share/omarchy) == "stable" ]] || fail "current channel detects stable" pass "current channel detects stable" -[[ $(current_channel rc stable) == "rc" ]] || fail "current channel detects rc" +[[ $(current_channel rc stable /usr/share/omarchy) == "rc" ]] || fail "current channel detects rc" pass "current channel detects rc" -[[ $(current_channel edge dev /dev/null /usr/share/omarchy) == "edge" ]] || fail "current channel detects package-backed edge" +[[ $(current_channel edge dev /usr/share/omarchy) == "edge" ]] || fail "current channel detects package-backed edge" pass "current channel detects package-backed edge" -[[ $(current_channel edge dev /dev/null "$test_tmp/dev-checkout") == "dev" ]] || fail "current channel detects dev from OMARCHY_PATH" +[[ $(current_channel edge dev "$test_tmp/dev-checkout") == "dev" ]] || fail "current channel detects dev from OMARCHY_PATH" pass "current channel detects dev from OMARCHY_PATH" - -conf="$test_tmp/omarchy.conf" -printf 'export OMARCHY_PATH="%s"\n' "$test_tmp/dev-checkout" >"$conf" -[[ $(current_channel edge dev "$conf" /usr/share/omarchy) == "dev" ]] || fail "current channel detects dev from configured path" -pass "current channel detects dev from configured path"