Skip to content

Commit 7bd5fe3

Browse files
authored
fix: Use a different replacement function in bump-version (#2)
1 parent 156b37f commit 7bd5fe3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/bump-version.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ NEW_VERSION="${2}"
1010
echo "Current version: ${OLD_VERSION}"
1111
echo "Bumping version: ${NEW_VERSION}"
1212

13-
perl -pi -e "s/^version = \".*?\"/version = \"$NEW_VERSION\"/" Cargo.toml
13+
function replace() {
14+
! grep "$2" $3
15+
perl -i -pe "s/$1/$2/g" $3
16+
grep "$2" $3 # verify that replacement was successful
17+
}
18+
19+
replace "^version = \".*?\"" "version = \"$NEW_VERSION\"" Cargo.toml

0 commit comments

Comments
 (0)