Skip to content

Commit 2db7cb1

Browse files
authored
Update generate-app-headers.sh
1 parent 7ff44c5 commit 2db7cb1

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

.github/workflows/scripts/generate-app-headers.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# Base directory for headers
44
headers_dir="./ct/headers"
55

6-
# Ensure the headers directory exists
6+
# Ensure the headers directory exists and clear it
77
mkdir -p "$headers_dir"
8+
rm -f "$headers_dir"/*
89

910
# Find all .sh files in ./ct directory, sorted alphabetically
1011
find ./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

Comments
 (0)