mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
FRAMEWORK: adding more info at startup + logger tweak
This commit is contained in:
parent
0eb2ea4aff
commit
7fd4a5aacb
|
@ -10,7 +10,12 @@
|
|||
rd_logs_folder="/var/config/retrodeck/logs" # Static location to write all RetroDECK-related logs
|
||||
source /app/libexec/logger.sh
|
||||
rotate_logs
|
||||
|
||||
log i "Initializing RetroDECK"
|
||||
log i "Running on $XDG_SESSION_DESKTOP, $XDG_SESSION_TYPE"
|
||||
if [[ -n $container ]]; then
|
||||
log i "$container environment"
|
||||
fi
|
||||
|
||||
source /app/libexec/050_save_migration.sh
|
||||
source /app/libexec/checks.sh
|
||||
|
|
|
@ -34,7 +34,7 @@ log() {
|
|||
local colorize_terminal=true
|
||||
|
||||
# Determine the calling function or use [FWORK]
|
||||
local caller="${FUNCNAME[1]:-[FWORK]}"
|
||||
local caller="${FUNCNAME[1]:-FWORK}"
|
||||
caller="${caller^^}" # Convert to uppercase
|
||||
|
||||
# Check if the shell is sh (not bash or zsh) to avoid colorization
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# TODO: finish me
|
||||
|
||||
# Set the organization name
|
||||
ORG="RetroDECK"
|
||||
|
||||
# Get all non-archived repositories of the organization
|
||||
repos=$(curl -s "https://api.github.com/orgs/$ORG/repos?per_page=100" | jq -r '.[] | select(has("archived") and .archived == false) | .name')
|
||||
|
||||
# Iterate over each repository
|
||||
for repo in $repos; do
|
||||
echo "Checking repository: $repo"
|
||||
|
||||
# Get the files in the root of the repository
|
||||
files=$(curl -s "https://api.github.com/repos/$ORG/$repo/contents" | jq -r '.[] | select(.type == "file" and (.path | index("/") == null)) | .name')
|
||||
|
||||
# Check for .yml, .yaml, and .json files
|
||||
for ext in yml yaml json; do
|
||||
file=$(echo "$files" | grep -E "\.$ext$")
|
||||
if [ -n "$file" ]; then
|
||||
# Download the file content
|
||||
content=$(curl -s "https://raw.githubusercontent.com/$ORG/$repo/main/$file")
|
||||
|
||||
# Check if it contains "runtime"
|
||||
if echo "$content" | grep -q "runtime"; then
|
||||
echo "Found in $file"
|
||||
app_id=$(echo "$content" | grep "app-id" | awk '{print $2}')
|
||||
runtime=$(echo "$content" | grep "runtime" | awk '{print $2}')
|
||||
runtime-version=$(echo "$content" | grep "runtime-version" | awk '{print $2}')
|
||||
sdk=$(echo "$content" | grep "sdk" | awk '{print $2}')
|
||||
|
||||
echo "Repository: $repo"
|
||||
echo "File: $file"
|
||||
echo "app-id: $app_id"
|
||||
echo "runtime: $runtime"
|
||||
echo "runtime-version: $runtime_version"
|
||||
echo "sdk: $sdk"
|
||||
echo "-------------------------"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
Loading…
Reference in a new issue