Commit b2cf9b37 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play common.sh: add snap_get_version()

parent c5a92911
...@@ -170,6 +170,14 @@ snap_get_pkgurl() ...@@ -170,6 +170,14 @@ snap_get_pkgurl()
eget -O- -H Snap-Device-Series:16 https://api.snapcraft.io/v2/snaps/info/$SNAPNAME | epm --inscript tool json -b | grep -A 8 "$ARCH" | grep '\["channel-map",[0-9],"download","url"\]' | head -n1 | sed 's/.*"\(https:\/\/.*\)".*/\1/' eget -O- -H Snap-Device-Series:16 https://api.snapcraft.io/v2/snaps/info/$SNAPNAME | epm --inscript tool json -b | grep -A 8 "$ARCH" | grep '\["channel-map",[0-9],"download","url"\]' | head -n1 | sed 's/.*"\(https:\/\/.*\)".*/\1/'
} }
snap_get_version()
{
local SNAPNAME="$1"
ARCH="$(epm print info --debian-arch)"
is_url "$SNAPNAME" && SNAPNAME="$(basename "$SNAPNAME")"
eget -O- -H Snap-Device-Series:16 https://api.snapcraft.io/v2/snaps/info/$SNAPNAME | parse_json_value '["channel-map",0,"version"]'
}
# return version only for the first package # return version only for the first package
get_latest_version() get_latest_version()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment