2025-01-10 10:44:42 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2025-01-24 13:03:59 +00:00
|
|
|
# Find all .sh files in ./ct directory, sorted alphabetically
|
2025-01-10 10:44:42 +00:00
|
|
|
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
|
2025-01-24 13:03:59 +00:00
|
|
|
# Define the output file name based on the .sh file
|
|
|
|
output_file="${script%.sh}.app"
|
|
|
|
|
|
|
|
# Check if the output file already exists
|
|
|
|
if [[ ! -f "$output_file" ]]; then
|
|
|
|
# Generate figlet output
|
|
|
|
figlet_output=$(figlet -f slant "$app_name")
|
|
|
|
|
|
|
|
# Write the figlet output to the file
|
|
|
|
echo "$figlet_output" > "$output_file"
|
|
|
|
echo "Generated: $output_file"
|
|
|
|
else
|
|
|
|
echo "Skipped: $output_file already exists"
|
|
|
|
fi
|
2025-01-10 10:44:42 +00:00
|
|
|
else
|
|
|
|
echo "No APP name found in $script, skipping."
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2025-01-24 13:03:59 +00:00
|
|
|
echo "Completed processing .sh files."
|