Skip to content

Commit 243fe1c

Browse files
committed
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.
1 parent bae1898 commit 243fe1c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎test/shell.d/theme-install-guards-test.sh‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,15 @@ done
7171
pass "a URL naming a transport git does not implement never reaches git"
7272

7373
# The checker is a separate command, so its absence has to refuse the URL rather
74-
# than wave it through to git.
75-
if install_theme "https://github.com/example/omarchy-cool-theme.git" "$mock_bin:$PATH"; then
74+
# than wave it through to git. Installed machines carry the packaged checker in
75+
# /usr/bin, so absence is simulated by shadowing it with a stub that reports
76+
# command-not-found instead of thinning the PATH.
77+
missing_checker_bin="$test_tmp/missing-checker-bin"
78+
mkdir -p "$missing_checker_bin"
79+
printf '#!/bin/bash\nexit 127\n' >"$missing_checker_bin/omarchy-git-url-check"
80+
chmod +x "$missing_checker_bin/omarchy-git-url-check"
81+
82+
if install_theme "https://github.com/example/omarchy-cool-theme.git" "$missing_checker_bin:$mock_bin:$ROOT/bin:$PATH"; then
7683
fail "omarchy-theme-install refuses a URL it cannot check"
7784
fi
7885

0 commit comments

Comments
 (0)