forked from EvergreenCrypto/docker-finance
container: src: lib_hledger: fork hledger-web, log print
Gives more convenient shell control for end-user.
This commit is contained in:
@@ -192,8 +192,20 @@ function lib_hledger::__hledger-web()
|
||||
{
|
||||
[ -z "${global_base_args[*]}" ] && lib_utils::die_fatal
|
||||
|
||||
local -r _url="http://127.0.0.1:5000"
|
||||
|
||||
hledger-web "${global_base_args[@]}" \
|
||||
--serve --host=0.0.0.0 --base-url http://127.0.0.1:5000 --allow=view "$@"
|
||||
--serve --host=0.0.0.0 --base-url "$_url" --allow=view "$@" 1>/dev/null &
|
||||
|
||||
local -r _pid=$!
|
||||
sleep 3s
|
||||
|
||||
if ! ps -p "$_pid" 1>/dev/null; then
|
||||
lib_utils::print_error "hledger-web failed. See above error message"
|
||||
else
|
||||
lib_utils::print_info "hledger-web started (PID ${_pid}). Point web browser to $_url"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
|
||||
Reference in New Issue
Block a user