mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-06-30 02:57:38 +00:00
Switch from workflows to scripts folder
This commit is contained in:
33
.github/workflows/scripts/generate-app-headers.sh
vendored
Normal file
33
.github/workflows/scripts/generate-app-headers.sh
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
output_file="./misc/.app-headers"
|
||||
> "$output_file" # Clear or create the file
|
||||
|
||||
current_date=$(date +"%m-%d-%Y")
|
||||
# Header with date
|
||||
{
|
||||
echo "### Generated on $current_date"
|
||||
echo "##################################################"
|
||||
echo
|
||||
} >> "$output_file"
|
||||
|
||||
# Find only regular .sh files in ./ct, sort them alphabetically
|
||||
find ./ct -type f -name "*.sh" | sort | while read -r script; do
|
||||
# Extract the APP name from the APP line
|
||||
app_name=$(grep -oP '^APP="\K[^"]+' "$script" 2>/dev/null)
|
||||
|
||||
if [[ -n "$app_name" ]]; then
|
||||
# Generate figlet output
|
||||
figlet_output=$(figlet -f slant "$app_name")
|
||||
{
|
||||
echo "### $(basename "$script")"
|
||||
echo "APP=$app_name"
|
||||
echo "$figlet_output"
|
||||
echo
|
||||
} >> "$output_file"
|
||||
else
|
||||
echo "No APP name found in $script, skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Generated combined file at $output_file"
|
23
.github/workflows/scripts/update_json_date.sh
vendored
Normal file
23
.github/workflows/scripts/update_json_date.sh
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Verzeichnis, das die JSON-Dateien enthält
|
||||
json_dir="./json/*.json"
|
||||
|
||||
current_date=$(date +"%Y-%m-%d")
|
||||
|
||||
for json_file in $json_dir; do
|
||||
if [[ -f "$json_file" ]]; then
|
||||
current_json_date=$(jq -r '.date_created' "$json_file")
|
||||
|
||||
if [[ "$current_json_date" != "$current_date" ]]; then
|
||||
echo "Updating $json_file with date $current_date"
|
||||
jq --arg date "$current_date" '.date_created = $date' "$json_file" > temp.json && mv temp.json "$json_file"
|
||||
|
||||
git add "$json_file"
|
||||
git commit -m "Update date_created to $current_date in $json_file"
|
||||
else
|
||||
echo "Date in $json_file is already up to date."
|
||||
fi
|
||||
fi
|
||||
done
|
||||
git push origin HEAD
|
Reference in New Issue
Block a user