From 7545a4229c8add9c4bb91307e1762f69c21441cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84min=20Baumeler?= Date: Wed, 9 Jul 2025 12:59:19 +0200 Subject: [PATCH] bugfix: ensure functions are loaded before internal cli calls --- src/main.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main.sh b/src/main.sh index 45e15cd..a89f666 100644 --- a/src/main.sh +++ b/src/main.sh @@ -2,21 +2,24 @@ set -eu +# Always load functions +# Helper functions +. "sh/helper.sh" +# iCalendar routines +. "sh/icalendar.sh" +# Attachment handling +. "sh/attachment.sh" +# Categories handling +. "sh/categories.sh" + +# Load environment variables only when not yet loaded if [ ! "${SCRIPT_LOADED:-}" ]; then - # Helper functions - . "sh/helper.sh" - # Read theme - . "sh/theme.sh" # Read configuration . "sh/config.sh" + # Read theme + . "sh/theme.sh" # Load awk scripts . "sh/awkscripts.sh" - # iCalendar routines - . "sh/icalendar.sh" - # Attachment handling - . "sh/attachment.sh" - # Categories handling - . "sh/categories.sh" # Mark as loaded export SCRIPT_LOADED=1 fi