mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 05:57:26 +00:00
Initial Release
This commit is contained in:
34
.github/workflows/scripts/generate-app-headers.sh
vendored
Normal file
34
.github/workflows/scripts/generate-app-headers.sh
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Base directory for headers
|
||||
headers_dir="./ct/headers"
|
||||
|
||||
# Ensure the headers directory exists and clear it
|
||||
mkdir -p "$headers_dir"
|
||||
rm -f "$headers_dir"/*
|
||||
|
||||
# Find all .sh files in ./ct directory, sorted 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
|
||||
# Define the output file name in the headers directory
|
||||
output_file="${headers_dir}/$(basename "${script%.*}")"
|
||||
|
||||
# Generate figlet output
|
||||
figlet_output=$(figlet -w 500 -f slant "$app_name")
|
||||
|
||||
# Check if figlet output is not empty
|
||||
if [[ -n "$figlet_output" ]]; then
|
||||
echo "$figlet_output" > "$output_file"
|
||||
echo "Generated: $output_file"
|
||||
else
|
||||
echo "Figlet failed for $app_name in $script"
|
||||
fi
|
||||
else
|
||||
echo "No APP name found in $script, skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Completed processing .sh files."
|
||||
Reference in New Issue
Block a user