mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-01-10 19:05:09 +00:00
44994bb919
* add figlet generation files * Update generate-app-headers.yaml * Update generate-app-headers.sh
34 lines
882 B
Bash
34 lines
882 B
Bash
#!/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"
|