Skip to content

Commit f2256bd

Browse files
committed
fix(ci): make install guardrails runner-agnostic
1 parent 86c1dac commit f2256bd

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

scripts/check-install-commands.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ fail() {
66
exit 1
77
}
88

9+
find_fixed() {
10+
local pattern="$1"
11+
shift
12+
if command -v rg >/dev/null 2>&1; then
13+
rg -nF "$pattern" "$@"
14+
else
15+
grep -R -n -F -- "$pattern" "$@"
16+
fi
17+
}
18+
919
assert_contains() {
1020
local pattern="$1"
1121
shift
12-
if ! rg -nF "$pattern" "$@" >/dev/null; then
22+
if ! find_fixed "$pattern" "$@" >/dev/null; then
1323
fail "Missing required install command: ${pattern}"
1424
fi
1525
}

0 commit comments

Comments
 (0)