mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +00:00
bitbucket versions listing helper: add xz file support
This commit is contained in:
parent
a4d9ed4cf3
commit
f50bd21aff
@ -5,10 +5,13 @@ if [ -z "$1" ]; then
|
|||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
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"
|
||||||
url="https://api.bitbucket.org/2.0/repositories/$1/downloads?pagelen=100&_=$(date +%s)"
|
url="https://api.bitbucket.org/2.0/repositories/$1/downloads?pagelen=100&_=$(date +%s)"
|
||||||
jq_expr='.values[] | [{a: .name | split("-"), url: .links.self.href}] | map((.a[2] | rtrimstr(".img.gz") | rtrimstr(".img")), "false", .a[1], .url) | join("|")'
|
|
||||||
|
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(\"|\")"
|
||||||
|
|
||||||
curl $opts $url | jq --raw-output "$jq_expr"
|
curl $opts $url | jq --raw-output "$jq_expr"
|
||||||
exit ${PIPESTATUS[0]}
|
exit ${PIPESTATUS[0]}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user