From 3043e1238230cb3ece531f228a1d7aef3ab02557 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Wed, 25 Nov 2026 10:50:06 -0500 Subject: [PATCH] Make rad-ignores.sh independent of checkout directory name The script refused to run unless the current directory was named ruby-advisory-db, and exited 0 when it refused. Forks or CI checkouts with another name silently skipped every ignore. cd to the repo root relative to the script instead, so it works from any directory and any checkout name. The script now also exits 1 if the cd fails; it used to exit 0 when refusing. --- lib/rad-ignores.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/rad-ignores.sh b/lib/rad-ignores.sh index c571b75f07..fc3535f69f 100755 --- a/lib/rad-ignores.sh +++ b/lib/rad-ignores.sh @@ -2,13 +2,9 @@ echo "In rad-ignores.sh" -REPON="ruby-advisory-db" -if [ "X`pwd |sed -e "s,.*/,,"`X" == "X${REPON}X" ] ; then - : -else - echo "Change dir to [${REPON}] first." - exit -fi +# The rm commands below use paths relative to the repo root, so run from +# there regardless of the caller's directory or the checkout's name. +cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1 # 10/26/2024, 5/25/2026: Autolab is not a Rubygem so remove it. # 7/13/2026: Found 10 more so added them here.