Skip to content

Commit 19787ab

Browse files
committed
chore: fix release-pkg.sh for #4818
Fix regression introduced by #4818 that two lines starting with `version =` appears in the file.
1 parent b2fb2ef commit 19787ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

devtools/release/release-pkg.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
on_push_pkg() {
44
BRANCH=$(git symbolic-ref --quiet HEAD)
55
BRANCH="${BRANCH#refs/heads/}"
6-
VERSION="v$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)"
6+
VERSION="v$(sed -n '/^version = "\(.*\)"/{s//\1/p;q}' Cargo.toml)"
77
echo "$BRANCH -> upstream/$BRANCH"
88
echo "$BRANCH -> upstream/pkg/$VERSION"
99

1010
git push upstream "$BRANCH" "$BRANCH:pkg/$VERSION"
1111
}
1212

1313
on_tag() {
14-
VERSION="v$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)"
14+
VERSION="v$(sed -n '/^version = "\(.*\)"/{s//\1/p;q}' Cargo.toml)"
1515
git tag -s -m "$VERSION" "$VERSION"
1616
}
1717

1818
on_push_tag() {
19-
VERSION="v$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)"
19+
VERSION="v$(sed -n '/^version = "\(.*\)"/{s//\1/p;q}' Cargo.toml)"
2020
git push upstream "$VERSION"
2121
}
2222

0 commit comments

Comments
 (0)