container: finance: add dependency checks for modules

Since modules are included upon build type, if a build doesn't support
a feature then that feature's dependencies will not be available.

This commit will give notice of those missing dependencies.
This commit is contained in:
2024-09-16 21:51:59 -07:00
parent 6d0a38f6b5
commit 0b2c76a813
6 changed files with 19 additions and 5 deletions

View File

@@ -201,6 +201,7 @@ function lib_edit::__parse_args()
function lib_edit::__edit()
{
[ -z "$EDITOR" ] && lib_utils::die_fatal
lib_utils::deps_check "$(basename $EDITOR)"
for _type in "${global_arg_type[@]}"; do
case "$_type" in
@@ -247,6 +248,7 @@ function lib_edit::__edit()
[ ! -f "$_path" ] && touch "$_path"
if [[ "$_type" == "iadd" ]]; then
lib_utils::deps_check "hledger-iadd"
hledger-iadd -f "$_path" || lib_utils::die_fatal
fi
@@ -274,6 +276,8 @@ function lib_edit::__edit()
# original file's comments.
local -r _skip="$(grep -E "^//!" $_path | wc -l)"
local -r _args=("--quitguard" "--motd-url" "file:///dev/null" "--filetype" "csv" "--skip" "$_skip" "$_path")
lib_utils::deps_check "visidata"
visidata "${_args[@]}" || lib_utils::die_fatal
# TODO: HACK: visidata saves w/ DOS-style carriage...