mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
list-versions-bitbucket: versions not starting with a digit are considered prereleases
This commit is contained in:
parent
1e87d81b74
commit
ce93017e44
@ -5,6 +5,15 @@ if [ -z "$1" ]; then
|
|||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function check_prerelease() {
|
||||||
|
read line
|
||||||
|
if [[ "$line" =~ ^[0-9] ]]; then
|
||||||
|
echo "$line"
|
||||||
|
else
|
||||||
|
echo "$line" | sed 's/|false|/|true|/'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
extensions=".img.gz .img.xz .img"
|
extensions=".img.gz .img.xz .img"
|
||||||
opts="-s -S -f"
|
opts="-s -S -f"
|
||||||
test -n "$FW_USERNAME" && opts+=" --user $FW_USERNAME:$FW_PASSWORD"
|
test -n "$FW_USERNAME" && opts+=" --user $FW_USERNAME:$FW_PASSWORD"
|
||||||
@ -13,6 +22,6 @@ url="https://api.bitbucket.org/2.0/repositories/$1/downloads?pagelen=100&_=$(dat
|
|||||||
rtrimstr=$(for e in $extensions; do echo -n " | rtrimstr(\"$e\")"; done)
|
rtrimstr=$(for e in $extensions; do echo -n " | rtrimstr(\"$e\")"; done)
|
||||||
jq_expr=".values[] | [{a: .name | split(\"-\"), url: .links.self.href}] | map((.a[2] $rtrimstr), \"false\", .a[1], .url) | join(\"|\")"
|
jq_expr=".values[] | [{a: .name | split(\"-\"), url: .links.self.href}] | map((.a[2] $rtrimstr), \"false\", .a[1], .url) | join(\"|\")"
|
||||||
|
|
||||||
curl $opts $url | jq --raw-output "$jq_expr"
|
curl $opts $url | jq --raw-output "$jq_expr" | while read line; do echo "$line" | check_prerelease; done
|
||||||
exit ${PIPESTATUS[0]}
|
exit ${PIPESTATUS[0]}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user