summarylogtreecommitdiffstats
path: root/download-deps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'download-deps.sh')
-rwxr-xr-xdownload-deps.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/download-deps.sh b/download-deps.sh
index 69e5a63683d..8919e58be16 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