From b16275b7cde2d0e170d45e43bcbbe579cb144151 Mon Sep 17 00:00:00 2001 From: Danny Kopping Date: Thu, 6 Mar 2025 12:21:14 +0200 Subject: [PATCH] chore: fix regex bug in migration number fixer (#16822) This fixes a slight regex bug on Bash 5, where `[:/]` would only match `:` but not both `:/`. ```bash $ git remote -v | grep "github.com[:/]coder/coder.*(fetch)" | cut -f1 $ git remote -v | grep "github.com[:/]*coder/coder.*(fetch)" | cut -f1 origin ``` The former will actually cause the whole script to bork because of `pipefail`, since `grep` exits 1. Signed-off-by: Danny Kopping --- coderd/database/migrations/fix_migration_numbers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/database/migrations/fix_migration_numbers.sh b/coderd/database/migrations/fix_migration_numbers.sh index 771ab8eda5..124c953881 100755 --- a/coderd/database/migrations/fix_migration_numbers.sh +++ b/coderd/database/migrations/fix_migration_numbers.sh @@ -11,7 +11,7 @@ list_migrations() { main() { cd "${SCRIPT_DIR}" - origin=$(git remote -v | grep "github.com[:/]coder/coder.*(fetch)" | cut -f1) + origin=$(git remote -v | grep "github.com[:/]*coder/coder.*(fetch)" | cut -f1) echo "Fetching ${origin}/main..." git fetch -u "${origin}" main