Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
5289769c
Commit
5289769c
authored
May 24, 2024
by
Boris Yumankulov
Committed by
Vitaly Lipatov
Nov 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm play common: add get_github_version function
parent
343d4454
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
common.sh
play.d/common.sh
+16
-2
No files found.
play.d/common.sh
View file @
5289769c
...
...
@@ -77,13 +77,11 @@ epm()
$EPM
"
$@
"
}
eget
()
{
epm tool eget
"
$@
"
}
is_supported_arch
()
{
local
i
...
...
@@ -159,6 +157,22 @@ get_latest_version()
done
}
get_github_version
()
{
is_command jq
||
fatal
"jq not found, please install jq"
local
url
=
"
$1
"
local
user_and_repo
=
${
url
#https
://github.com/
}
local
user_and_repo
=
${
user_and_repo
%/
}
local
asset_name
=
"
$2
"
if
[
"
$3
"
==
"prerelease"
]
;
then
curl
-s
"https://api.github.com/repos/
${
user_and_repo
}
/releases"
| jq
-r
'.[] | .assets[].browser_download_url'
|
grep
"
$2
"
|
head
-n1
else
curl
-s
"https://api.github.com/repos/
${
user_and_repo
}
/releases"
| jq
-r
'.[] | select(.prerelease == false) | .assets[].browser_download_url'
|
grep
"
$2
"
|
head
-n1
fi
}
print_product_alt
()
{
[
-n
"
$1
"
]
||
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment