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 <dannykopping@gmail.com>
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy