Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/core.func
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,15 @@ exit_script() {
# - Determines app type (ct/vm) from APP_TYPE variable
# - Returns header content or empty string on failure
# ------------------------------------------------------------------------------
# Drawn until the generator has produced a script's own banner (figlet slant,
# like the generated ones); the app name follows in plain text.
_CS_FALLBACK_HEADER=' ______ _ __ _____ _ __
/ ____/___ ____ ___ ____ ___ __ ______ (_) /___ __ / ___/__________(_)___ / /______
/ / / __ \/ __ `__ \/ __ `__ \/ / / / __ \/ / __/ / / / \__ \/ ___/ ___/ / __ \/ __/ ___/
/ /___/ /_/ / / / / / / / / / / / /_/ / / / / / /_/ /_/ / ___/ / /__/ / / / /_/ / /_(__ )
\____/\____/_/ /_/ /_/_/ /_/ /_/\__,_/_/ /_/_/\__/\__, / /____/\___/_/ /_/ .___/\__/____/
/____/ /_/'

get_header() {
# Slug must match what the generator writes: APP lowercased, spaces removed.
local app_name=$(echo "${APP,,}" | tr -d ' ')
Expand Down Expand Up @@ -1483,6 +1492,9 @@ header_info() {

if [ -n "$header_content" ]; then
echo "$header_content"
else
echo "${_CS_FALLBACK_HEADER:-Community Scripts}"
echo " ${APP:-}"
fi
}

Expand Down
7 changes: 6 additions & 1 deletion incus/build.func
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,12 @@ header_info() {
header_content=$(get_header "$app_name" 2>/dev/null || true)
fi
clear 2>/dev/null || true
[[ -n "$header_content" ]] && echo "$header_content"
if [[ -n "$header_content" ]]; then
echo "$header_content"
else
echo "${_CS_FALLBACK_HEADER:-Community Scripts}"
echo " ${APP:-}"
fi
return 0
}

Expand Down
3 changes: 2 additions & 1 deletion incus/tools.func
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ header_info() {
if [[ -n "$header_content" ]]; then
echo "$header_content"
else
echo -e "${INCUS_HEADER:-Incus :: ${APP:-Container}}"
echo "${_CS_FALLBACK_HEADER:-Community Scripts}"
echo " ${APP:-}"
fi
}

Expand Down
14 changes: 8 additions & 6 deletions incus/vm-core.func
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,20 @@ load_incus_vm_functions() {
load_functions() { load_incus_vm_functions; }

header_info() {
# get_header derives the slug from APP and APP_TYPE itself. Same contract as
# the Proxmox path: no banner means draw nothing. The text fallback this used
# to print ("Incus VM :: Home Assistant OS") read like the banner had been
# replaced on purpose, so a header that simply failed to fetch looked like a
# deliberate design rather than the missing artwork it is.
# get_header derives the slug from APP and APP_TYPE itself; without a banner
# the shared placeholder from core.func is drawn, same as on Proxmox.
local header_content=""
APP_TYPE="${APP_TYPE:-vm}"
if declare -f get_header >/dev/null 2>&1; then
header_content=$(get_header 2>/dev/null || true)
fi
_cs_clear
[[ -n "$header_content" ]] && echo "$header_content"
if [[ -n "$header_content" ]]; then
echo "$header_content"
else
echo "${_CS_FALLBACK_HEADER:-Community Scripts}"
echo " ${APP:-}"
fi
return 0
}

Expand Down
3 changes: 3 additions & 0 deletions pve/vm-core.func
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ header_info() {

if [ -n "$header_content" ]; then
echo "$header_content"
else
echo "${_CS_FALLBACK_HEADER:-Community Scripts}"
echo " ${APP:-}"
fi
}

Expand Down
Loading