mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	Update generate-app-headers.sh
This commit is contained in:
		@@ -3,8 +3,9 @@
 | 
			
		||||
# Base directory for headers
 | 
			
		||||
headers_dir="./ct/headers"
 | 
			
		||||
 | 
			
		||||
# Ensure the headers directory exists
 | 
			
		||||
# 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
 | 
			
		||||
@@ -15,20 +16,15 @@ find ./ct -type f -name "*.sh" | sort | while read -r script; do
 | 
			
		||||
    # Define the output file name in the headers directory
 | 
			
		||||
    output_file="${headers_dir}/$(basename "${script%.*}")"
 | 
			
		||||
 | 
			
		||||
    # Check if the output file already exists
 | 
			
		||||
    if [[ ! -f "$output_file" ]]; then
 | 
			
		||||
      # Generate figlet output
 | 
			
		||||
      figlet_output=$(figlet -f slant "$app_name")
 | 
			
		||||
    # Generate figlet output
 | 
			
		||||
    figlet_output=$(figlet -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
 | 
			
		||||
    # Check if figlet output is not empty
 | 
			
		||||
    if [[ -n "$figlet_output" ]]; then
 | 
			
		||||
      echo "$figlet_output" > "$output_file"
 | 
			
		||||
      echo "Generated: $output_file"
 | 
			
		||||
    else
 | 
			
		||||
      echo "Skipped: $output_file already exists"
 | 
			
		||||
      echo "Figlet failed for $app_name in $script"
 | 
			
		||||
    fi
 | 
			
		||||
  else
 | 
			
		||||
    echo "No APP name found in $script, skipping."
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user