container: src: lib_hledger: remove hledger version test

No longer needed because 1.40 is the minimum version provided by the
current build (courtesty of repo 'Dockerfiles/remote/hledger-suite').
This commit is contained in:
2024-09-23 22:33:12 -07:00
parent a9e1ee39d3
commit 5acbbfb799

View File

@@ -70,30 +70,11 @@ function lib_hledger::hledger-web()
# Constructor
function lib_hledger::__hledger()
{
# Base arguments to hledger before end-user added
# Base arguments to hledger suite before end-user added
[ -z "$global_conf_hledger" ] && lib_utils::die_fatal
[ -z "$global_child_profile_journal" ] && lib_utils::die_fatal
declare -g global_base_args=("-f" "$global_child_profile_journal")
#
# Apply features to given hledger version.
#
# CLI version formats:
#
# hledger 1.34, linux-x86_64
# hledger 1.34.99-gcf0c7c2ef-20240702, linux-x86_64
#
# TODO: remove now that 1.40 is guaranteed minimum
# 1.34.99 and above
hledger --version \
| gawk '{ if ($2 !~ /^1.3(4.99|([5-9][\.[0-99]?))/) { exit 1 } }' FS=' '
if [ $? -eq 0 ]; then
# --conf is supported
[ -z "$global_conf_hledger" ] && lib_utils::die_fatal
global_base_args+=("--conf" "$global_conf_hledger")
fi
declare -g global_base_args=("--conf" "$global_conf_hledger" "-f" "$global_child_profile_journal")
lib_utils::print_debug "${global_base_args[*]}" "$@"
}