mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-25 01:13:40 +00:00
Update generate-app-headers.sh
This commit is contained in:
parent
7ff44c562b
commit
2db7cb1fdb
@ -3,8 +3,9 @@
|
|||||||
# Base directory for headers
|
# Base directory for headers
|
||||||
headers_dir="./ct/headers"
|
headers_dir="./ct/headers"
|
||||||
|
|
||||||
# Ensure the headers directory exists
|
# Ensure the headers directory exists and clear it
|
||||||
mkdir -p "$headers_dir"
|
mkdir -p "$headers_dir"
|
||||||
|
rm -f "$headers_dir"/*
|
||||||
|
|
||||||
# Find all .sh files in ./ct directory, sorted alphabetically
|
# Find all .sh files in ./ct directory, sorted alphabetically
|
||||||
find ./ct -type f -name "*.sh" | sort | while read -r script; do
|
find ./ct -type f -name "*.sh" | sort | while read -r script; do
|
||||||
@ -15,8 +16,6 @@ find ./ct -type f -name "*.sh" | sort | while read -r script; do
|
|||||||
# Define the output file name in the headers directory
|
# Define the output file name in the headers directory
|
||||||
output_file="${headers_dir}/$(basename "${script%.*}")"
|
output_file="${headers_dir}/$(basename "${script%.*}")"
|
||||||
|
|
||||||
# Check if the output file already exists
|
|
||||||
if [[ ! -f "$output_file" ]]; then
|
|
||||||
# Generate figlet output
|
# Generate figlet output
|
||||||
figlet_output=$(figlet -f slant "$app_name")
|
figlet_output=$(figlet -f slant "$app_name")
|
||||||
|
|
||||||
@ -27,9 +26,6 @@ find ./ct -type f -name "*.sh" | sort | while read -r script; do
|
|||||||
else
|
else
|
||||||
echo "Figlet failed for $app_name in $script"
|
echo "Figlet failed for $app_name in $script"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "Skipped: $output_file already exists"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "No APP name found in $script, skipping."
|
echo "No APP name found in $script, skipping."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user