ProxmoxVE/.github/workflows/generate-app-headers.sh
CanbiZ 44994bb919
[Core] add Github Action for Generate AppHeaders (figlet remove part 1) (#1382)
* add figlet generation files

* Update generate-app-headers.yaml

* Update generate-app-headers.sh
2025-01-10 11:44:42 +01:00

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"