Skip to content

Commit dc8c583

Browse files
committed
fix(crc32c): escape version dot and anchor pyenv check regex to prevent matching sub-versions like 3.13.14
1 parent a0da993 commit dc8c583

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/google-crc32c/scripts/osx/build_python_wheel.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ eval "$(pyenv init --path)"
3939

4040
install_python_pyenv() {
4141
version=$1
42+
escaped_version="${version//./\.}"
4243

43-
if [ -z "$(pyenv versions --bare | grep $version)" ]; then
44+
if [ -z "$(pyenv versions --bare | grep "^${escaped_version}\b")" ]; then
4445
echo "Python $version is not installed. Installing..."
4546
pyenv install $version
4647
echo "Python $version installed."

packages/google-crc32c/scripts/osx/publish_python_wheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
set -eo pipefail
1717

18-
if [ -z "$(pyenv versions --bare | grep 3.10)" ]; then
18+
if [ -z "$(pyenv versions --bare | grep "^3\.10\b")" ]; then
1919
echo "Python 3.10 is not installed. Installing..."
2020
pyenv install 3.10
2121
fi

0 commit comments

Comments
 (0)