Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b16275b

Browse files
authored
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 <[email protected]>
1 parent 0c27f04 commit b16275b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coderd/database/migrations/fix_migration_numbers.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ list_migrations() {
1111
main() {
1212
cd "${SCRIPT_DIR}"
1313

14-
origin=$(git remote -v | grep "github.com[:/]coder/coder.*(fetch)" | cut -f1)
14+
origin=$(git remote -v | grep "github.com[:/]*coder/coder.*(fetch)" | cut -f1)
1515

1616
echo "Fetching ${origin}/main..."
1717
git fetch -u "${origin}" main

0 commit comments

Comments
 (0)