diff options
Diffstat (limited to 'download-deps.sh')
-rwxr-xr-x | download-deps.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/download-deps.sh b/download-deps.sh index 69e5a63683df..8919e58be164 100755 --- a/download-deps.sh +++ b/download-deps.sh @@ -51,8 +51,12 @@ onlinebestmatch() { json=$(echo "$json" | jq '.[0]') fi local version="$(echo "$json" | jq -r '.version' | head -n1)" - - local latestversion="$(echo "$json" | jq '.versions | .[]' | xargs semver -r "$semverspec" | tail -n1)" + local latestversion + if [ "$semverspec" = "latest" ]; then + latestversion="$(echo "$json" | jq -r '.versions | .[]' | tail -n1)" + else + latestversion="$(echo "$json" | jq '.versions | .[]' | xargs semver -r "$semverspec" | tail -n1)" + fi if [ "$version" != "$latestversion" ]; then json="$(npm view --json "$package@$latestversion")" fi |