mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user