container: lib_hledger: only feed visidata on valid hledger command
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# docker-finance | modern accounting for the power-user
|
# docker-finance | modern accounting for the power-user
|
||||||
#
|
#
|
||||||
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
# Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -167,7 +167,12 @@ function lib_hledger::__hledger-vui()
|
|||||||
[ -z "$global_conf_visidata" ] && lib_utils::die_fatal
|
[ -z "$global_conf_visidata" ] && lib_utils::die_fatal
|
||||||
|
|
||||||
local -r _visidata=("--visidata-dir" "$global_conf_visidata" "--motd-url" "file:///dev/null" "--filetype" "csv")
|
local -r _visidata=("--visidata-dir" "$global_conf_visidata" "--motd-url" "file:///dev/null" "--filetype" "csv")
|
||||||
visidata "${_visidata[@]}" < <(hledger "${global_base_args[@]}" print -O csv "$@")
|
local -r _hledger=("hledger" "${global_base_args[@]}" "print" "-O" "csv" "$@")
|
||||||
|
|
||||||
|
# If hledger command is valid, output into visidata
|
||||||
|
if "${_hledger[@]}" 1>/dev/null; then
|
||||||
|
visidata "${_visidata[@]}" < <("${_hledger[@]}")
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function lib_hledger::__hledger-web()
|
function lib_hledger::__hledger-web()
|
||||||
|
|||||||
Reference in New Issue
Block a user