update
This commit is contained in:
parent
d04a9f26b2
commit
9f4812f139
1 changed files with 2 additions and 14 deletions
16
master.sh
16
master.sh
|
@ -110,22 +110,10 @@ remove_script() {
|
||||||
# Modified fetch_scripts function for Forgejo API
|
# Modified fetch_scripts function for Forgejo API
|
||||||
fetch_scripts() {
|
fetch_scripts() {
|
||||||
# Forgejo API endpoint for getting repository contents
|
# Forgejo API endpoint for getting repository contents
|
||||||
api_url="https://$forgejo_instance/api/v1/repos/$forgejo_owner/$forgejo_repo/contents?ref=$BRANCH"
|
api_url="https://$forgejo_instance/api/v1/repos/$forgejo_owner/$forgejo_repo/git/trees/$BRANCH?recursive=1"
|
||||||
|
|
||||||
# Get all files recursively and filter for .sh files
|
# Get all files recursively and filter for .sh files
|
||||||
all_scripts=$(curl -s "$api_url" | jq -r '.[] | select(.type == "file" or .type == "dir") |
|
all_scripts=$(curl -s "$api_url" | jq -r '.tree[] | select(.path | endswith(".sh")) | .path' | sort -u)
|
||||||
if .type == "file" and (.name | endswith(".sh")) then .path
|
|
||||||
elif .type == "dir" then
|
|
||||||
"'$api_url'/\(.path)"
|
|
||||||
else empty end' |
|
|
||||||
while read -r path; do
|
|
||||||
if [[ $path == http* ]]; then
|
|
||||||
# Fetch contents of subdirectories
|
|
||||||
curl -s "$path" | jq -r '.[] | select(.type == "file" and (.name | endswith(".sh"))) | .path'
|
|
||||||
else
|
|
||||||
echo "$path"
|
|
||||||
fi
|
|
||||||
done | sort -u)
|
|
||||||
|
|
||||||
# Log silently without displaying
|
# Log silently without displaying
|
||||||
if [[ "$verbose" == "true" ]]; then
|
if [[ "$verbose" == "true" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue