Drop OMARCHY_PATH fallback and conf reading in channel detection
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user