bugfix: ensure functions are loaded before internal cli calls
This commit is contained in:
23
src/main.sh
23
src/main.sh
@@ -2,21 +2,24 @@
|
|||||||
|
|
||||||
set -eu
|
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
|
if [ ! "${SCRIPT_LOADED:-}" ]; then
|
||||||
# Helper functions
|
|
||||||
. "sh/helper.sh"
|
|
||||||
# Read theme
|
|
||||||
. "sh/theme.sh"
|
|
||||||
# Read configuration
|
# Read configuration
|
||||||
. "sh/config.sh"
|
. "sh/config.sh"
|
||||||
|
# Read theme
|
||||||
|
. "sh/theme.sh"
|
||||||
# Load awk scripts
|
# Load awk scripts
|
||||||
. "sh/awkscripts.sh"
|
. "sh/awkscripts.sh"
|
||||||
# iCalendar routines
|
|
||||||
. "sh/icalendar.sh"
|
|
||||||
# Attachment handling
|
|
||||||
. "sh/attachment.sh"
|
|
||||||
# Categories handling
|
|
||||||
. "sh/categories.sh"
|
|
||||||
# Mark as loaded
|
# Mark as loaded
|
||||||
export SCRIPT_LOADED=1
|
export SCRIPT_LOADED=1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user