Commit 8cce97bc authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play.d/common.sh: use exported EPMVERSION instead of epm subprocess

parent 28cd318a
......@@ -58,6 +58,13 @@ is_url()
echo "$1" | grep -q "^[filehtps]*:/"
}
# return major epm version (e.g. 3.64 from 3.64.49)
epm_major_version()
{
local ver="${EPMVERSION%%-*}"
echo "${ver%.*}"
}
#__showcmd_shifted()
#{
......@@ -203,11 +210,10 @@ snap_get_version()
load_latest_version()
{
local line
local epmver="$(epm --short --version 2>/dev/null)"
local epmver="$(epm_major_version)"
local URL
VERSION=""
RELEASE=""
epmver=$(echo "$epmver" | sed -e 's|\.[0-9]*$||')
for URL in "https://eepm.ru/releases/$epmver/app-versions" ; do
echo "Getting latest version from $URL/$1 ..." >&2
line="$(eget -q -O- "$URL/$1" 2>/dev/null)" || continue
......
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