33# Base directory for headers
44headers_dir=" ./ct/headers"
55
6- # Ensure the headers directory exists
6+ # Ensure the headers directory exists and clear it
77mkdir -p " $headers_dir "
8+ rm -f " $headers_dir " /*
89
910# Find all .sh files in ./ct directory, sorted alphabetically
1011find ./ct -type f -name " *.sh" | sort | while read -r script; do
@@ -15,20 +16,15 @@ find ./ct -type f -name "*.sh" | sort | while read -r script; do
1516 # Define the output file name in the headers directory
1617 output_file=" ${headers_dir} /$( basename " ${script% .* } " ) "
1718
18- # Check if the output file already exists
19- if [[ ! -f " $output_file " ]]; then
20- # Generate figlet output
21- figlet_output=$( figlet -f slant " $app_name " )
19+ # Generate figlet output
20+ figlet_output=$( figlet -f slant " $app_name " )
2221
23- # Check if figlet output is not empty
24- if [[ -n " $figlet_output " ]]; then
25- echo " $figlet_output " > " $output_file "
26- echo " Generated: $output_file "
27- else
28- echo " Figlet failed for $app_name in $script "
29- fi
22+ # Check if figlet output is not empty
23+ if [[ -n " $figlet_output " ]]; then
24+ echo " $figlet_output " > " $output_file "
25+ echo " Generated: $output_file "
3026 else
31- echo " Skipped: $output_file already exists "
27+ echo " Figlet failed for $app_name in $script "
3228 fi
3329 else
3430 echo " No APP name found in $script , skipping."
0 commit comments