mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-09-11 14:35:30 +03:00
fix: php: semver parsing fix trim
trim did not work correctly for version ranges: 5.0 - 5.8 5.0 - 5.8 | 6.* | ^7.1
This commit is contained in:
parent
565ae93893
commit
55d2536e4c
@ -50,12 +50,12 @@
|
||||
cleanConstraint
|
||||
);
|
||||
|
||||
splitAlternatives = v: let
|
||||
splitAlternatives = v: (let
|
||||
# handle version alternatives: ^1.2 || ^2.0
|
||||
trim = s: l.head (l.match "^[[:space:]]*([^[:space:]]*)[[:space:]]*$" s);
|
||||
trim = s: l.head (l.match "^[[:space:]]*(.*[^[:space:]])[[:space:]]*$" s);
|
||||
clean = l.replaceStrings ["||"] ["|"] v;
|
||||
in
|
||||
map trim (l.splitString "|" clean);
|
||||
map trim (l.splitString "|" clean));
|
||||
in {
|
||||
# 1.0.2 ~1.0.1
|
||||
# matching a version with semver
|
||||
|
Loading…
Reference in New Issue
Block a user