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
4357e2bb
Commit
4357e2bb
authored
May 05, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm play.d/common.sh: detect GitHub API errors instead of silently failing
parent
c53aa076
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
common.sh
play.d/common.sh
+23
-11
No files found.
play.d/common.sh
View file @
4357e2bb
...
...
@@ -102,7 +102,7 @@ eget()
fetch_url
()
{
info
"Fetching
$1
..."
$EPM
--quiet
tool eget
-q
-O-
"
$1
"
$EPM
--quiet
tool eget
-q
-O-
"
$1
"
||
return
1
}
...
...
@@ -286,12 +286,21 @@ get_github_release_info() {
local
url
=
"
$1
"
local
flag
=
"
$2
"
local
user_and_repo
=
${
url
#https
://github.com/
}
user_and_repo
=
"
${
user_and_repo
%/
}
"
local
api_url result
if
[
"
$flag
"
=
"latest"
]
;
then
fetch_url
"https://api.github.com/repos/
${
user_and_repo
%/
}
/releases/latest"
api_url
=
"https://api.github.com/repos/
$user_and_repo
/releases/latest"
else
fetch_url
"https://api.github.com/repos/
${
user_and_repo
%/
}
/releases"
api_url
=
"https://api.github.com/repos/
$user_and_repo
/releases"
fi
result
=
"
$(
fetch_url
"
$api_url
"
)
"
||
return
1
[
-n
"
$result
"
]
||
return
1
if
echo
"
$result
"
|
head
-c
200 |
grep
-q
'"message":[[:space:]]*"Not Found"'
;
then
return
1
fi
echo
"
$result
"
}
# Extract browser_download_url values from GitHub release JSON via epm tool json.
...
...
@@ -321,18 +330,21 @@ get_github_url()
#echo "$asset_name" | grep -q "\.[*?]" && fatal "Only glob symbols * and ? are supported. Don't use regexp! Input string: $asset_name"
wc
=
"
$(
__convert_glob__to_regexp
"
$asset_name
"
)
"
if
[
"
$3
"
==
"prerelease"
]
;
then
get_github_release_info
"
$url
"
| __get_github_download_urls |
grep
-E
"
$wc
"
|
head
-n1
local
info
result
=
''
if
[
"
$3
"
=
"prerelease"
]
;
then
info
=
"
$(
get_github_release_info
"
$url
"
)
"
||
\
fatal
"GitHub repository
$user_and_repo
not found or unreachable"
result
=
"
$(
echo
"
$info
"
| __get_github_download_urls |
grep
-E
"
$wc
"
|
head
-n1
)
"
else
local
result
result
=
"
$(
get_github_release_info
"
$url
"
"latest
"
| __get_github_download_urls |
grep
-E
"
$wc
"
|
head
-n1
)
"
info
=
"
$(
get_github_release_info
"
$url
"
"latest"
)
"
&&
\
result
=
"
$(
echo
"
$info
"
| __get_github_download_urls |
grep
-E
"
$wc
"
|
head
-n1
)
"
if
[
-z
"
$result
"
]
;
then
result
=
"
$(
get_github_release_info
"
$url
"
\
| __get_github_download_urls |
grep
-E
"
$wc
"
|
head
-n1
)
"
info
=
"
$(
get_github_release_info
"
$url
"
)
"
||
\
fatal
"GitHub repository
$user_and_repo
not found or unreachable"
result
=
"
$(
echo
"
$info
"
| __get_github_download_urls |
grep
-E
"
$wc
"
|
head
-n1
)
"
fi
echo
"
$result
"
fi
echo
"
$result
"
}
# Get asset checksum from GitHub latest release
...
...
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