bugfix: load variables and functions only once

This commit is contained in:
2025-07-07 22:17:24 +02:00
parent b2c8d94854
commit 56030912d7

View File

@@ -2,17 +2,24 @@
set -eu set -eu
# Helper functions if [ ! "${SCRIPT_LOADED:-}" ]; then
. "sh/helper.sh" # Helper functions
. "sh/helper.sh"
# Read theme # Read theme
. "sh/theme.sh" . "sh/theme.sh"
# Read configuration
# Read configuration . "sh/config.sh"
. "sh/config.sh" # Load awk scripts
. "sh/awkscripts.sh"
# Load awk scripts # iCalendar routines
. "sh/awkscripts.sh" . "sh/icalendar.sh"
# Attachment handling
. "sh/attachment.sh"
# Categories handling
. "sh/categories.sh"
# Mark as loaded
export SCRIPT_LOADED=1
fi
__lines() { __lines() {
find "$ROOT" -type f -name '*.ics' -print0 | xargs -0 -P 0 \ find "$ROOT" -type f -name '*.ics' -print0 | xargs -0 -P 0 \
@@ -90,9 +97,6 @@ Examples:
exit exit
fi fi
# iCalendar routines
. "sh/icalendar.sh"
# Command line arguments: Interal use # Command line arguments: Interal use
. "sh/cliinternal.sh" . "sh/cliinternal.sh"
@@ -102,12 +106,6 @@ fi
# Parse command-line filter (if any) # Parse command-line filter (if any)
. "sh/filter.sh" . "sh/filter.sh"
# Attachment handling
. "sh/attachment.sh"
# Categories handling
. "sh/categories.sh"
if [ -n "${list_option:-}" ]; then if [ -n "${list_option:-}" ]; then
__lines | __lines |
$FZF \ $FZF \