[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
This commit is contained in:
CanbiZ 2025-01-10 11:44:42 +01:00 committed by GitHub
parent 6f763a5059
commit 44994bb919
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 74 additions and 0 deletions

View 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"