pub2nix: Fix language version regex on Darwin

This commit is contained in:
hacker1024 2024-01-14 17:21:51 +11:00
parent dd5621df6d
commit ee18b58cf4

View File

@ -41,7 +41,7 @@ in
fi
languageConstraint="$(yq -r .environment.sdk "''${packageSources["$package"]}/''${packageRoots["$package"]}/pubspec.yaml")"
if [[ "$languageConstraint" =~ ^[[:space:]]*(\^|>=|>|)[[:space:]]*([[:digit:]]+\.[[:digit:]]+)\.[[:digit:]]+.*$ ]]; then
if [[ "$languageConstraint" =~ ^[[:space:]]*(\^|>=|>)?[[:space:]]*([[:digit:]]+\.[[:digit:]]+)\.[[:digit:]]+.*$ ]]; then
languageVersionJson="\"''${BASH_REMATCH[2]}\""
elif [ "$languageConstraint" = 'any' ]; then
languageVersionJson='null'