From 243fe1c9d9df5ba4e1da2a4dbfb67622cdfd98c8 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 30 Aug 2026 17:48:34 -0400 Subject: [PATCH] Shadow the git URL checker instead of thinning PATH The missing-checker case dropped $ROOT/bin from PATH to make omarchy-git-url-check unfindable, but installed machines carry the packaged checker in /usr/bin, so it was always found and the test failed on every 4.x machine. Shadow it with a stub that reports command-not-found so the scenario holds regardless of the host. --- test/shell.d/theme-install-guards-test.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/shell.d/theme-install-guards-test.sh b/test/shell.d/theme-install-guards-test.sh index 6c6044d0..2edc85dc 100755 --- a/test/shell.d/theme-install-guards-test.sh +++ b/test/shell.d/theme-install-guards-test.sh @@ -71,8 +71,15 @@ done pass "a URL naming a transport git does not implement never reaches git" # The checker is a separate command, so its absence has to refuse the URL rather -# than wave it through to git. -if install_theme "https://github.com/example/omarchy-cool-theme.git" "$mock_bin:$PATH"; then +# than wave it through to git. Installed machines carry the packaged checker in +# /usr/bin, so absence is simulated by shadowing it with a stub that reports +# command-not-found instead of thinning the PATH. +missing_checker_bin="$test_tmp/missing-checker-bin" +mkdir -p "$missing_checker_bin" +printf '#!/bin/bash\nexit 127\n' >"$missing_checker_bin/omarchy-git-url-check" +chmod +x "$missing_checker_bin/omarchy-git-url-check" + +if install_theme "https://github.com/example/omarchy-cool-theme.git" "$missing_checker_bin:$mock_bin:$ROOT/bin:$PATH"; then fail "omarchy-theme-install refuses a URL it cannot check" fi