mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-02-01 22:51:50 +00:00
Update generate-app-headers.sh
This commit is contained in:
parent
7c3ad9cfcf
commit
7723269bbc
@ -1,13 +1,19 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Base directory for headers
|
||||||
|
headers_dir="./ct/headers"
|
||||||
|
|
||||||
|
# Ensure the headers directory exists
|
||||||
|
mkdir -p "$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
|
||||||
# Extract the APP name from the APP line
|
# Extract the APP name from the APP line
|
||||||
app_name=$(grep -oP '^APP="\K[^"]+' "$script" 2>/dev/null)
|
app_name=$(grep -oP '^APP="\K[^"]+' "$script" 2>/dev/null)
|
||||||
|
|
||||||
if [[ -n "$app_name" ]]; then
|
if [[ -n "$app_name" ]]; then
|
||||||
# Define the output file name based on the .sh file
|
# Define the output file name in the headers directory
|
||||||
output_file="${script%.sh}.app"
|
output_file="${headers_dir}/$(basename "${script%.*}")"
|
||||||
|
|
||||||
# Check if the output file already exists
|
# Check if the output file already exists
|
||||||
if [[ ! -f "$output_file" ]]; then
|
if [[ ! -f "$output_file" ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user