FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
llama-cpp-python/scripts/get-releases.sh at conan · czoido/llama-cpp-python · GitHub
czoido
/
llama-cpp-python
Public
forked from
abetlen/llama-cpp-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
llama-cpp-python
/
scripts
/
get-releases.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
47 lines (38 loc) · 1.29 KB
Breadcrumbs
llama-cpp-python
/
scripts
/
get-releases.sh
Copy path
File metadata and controls
executable file
·
47 lines (38 loc) · 1.29 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!
/bin/bash
#
Function to get all releases
get_all_releases
() {
local
page=1
local
per_page=100
local
releases=
"
"
local
new_releases
#
Prepare headers
local
headers=(-H
"
Accept: application/vnd.github.v3+json
"
)
if
[
-n
"
$GITHUB_TOKEN
"
]
;
then
headers+=(-H
"
Authorization: Bearer
$GITHUB_TOKEN
"
)
fi
while
true
;
do
response=
$(
curl -s
"
${headers[@]}
"
\
"
https://api.github.com/repos/abetlen/llama-cpp-python/releases?page=
$page
&per_page=
$per_page
"
)
#
Check if the response is valid JSON
if
!
echo
"
$response
"
|
jq empty
>
/dev/null
2>&1
;
then
echo
"
Error: Invalid response from GitHub API
"
>&2
echo
"
Response:
$response
"
>&2
return
1
fi
new_releases=
$(
echo
"
$response
"
|
jq -r
'
.[].tag_name
'
)
if
[
-z
"
$new_releases
"
]
;
then
break
fi
releases=
"
$releases
$new_releases
"
((
page
++
))
done
echo
$releases
}
#
Get all releases and save to file
releases=
$(
get_all_releases
)
if
[
$?
-ne
0 ]
;
then
echo
"
Failed to fetch releases. Please check your internet connection and try again later.
"
>&2
exit
1
fi
echo
"
$releases
"
|
tr
'
'
'
\n
'
>
all_releases.txt
echo
"
All releases have been saved to all_releases.txt
"
Back
|
FazBrowse Home
|
New Git URL