Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detecting MAJOR_VERSION in linux #646

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

417-72KI
Copy link
Member

@417-72KI 417-72KI commented Mar 16, 2025

When swift --version returns like 6.0.3 installation script fails to get MAJOR_VERSION and modules are not copied into LIB_INSTALL_PATH.

@417-72KI 417-72KI marked this pull request as ready for review March 16, 2025 18:06
@@ -20,7 +20,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
else
BUILD_FOLDER=".build/debug"
swift build --disable-sandbox
MAJOR_VERSION=$(swift --version | awk '{for(i=1;i<=NF;i++){if($i ~ /^[0-9]+\.[0-9]+$/){print $i; break}}}' | cut -d '.' -f 1)
MAJOR_VERSION=$(swift --version | awk '{for(i=1;i<=NF;i++){if($i ~ /^[0-9]+\.[0-9]+\.[0-9]?$/){print $i; break}}}' | cut -d '.' -f 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a regex expert, but shouldn't this be (.[0-9]+)? To have all the group optional and support more than one digit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly, thank you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants