From 160cf2a534938ddc99843962af2751843351962e Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Mon, 25 Nov 2024 11:41:33 +0000 Subject: [PATCH] switch to use execCmdEX for hopefully better logging --- norg.nimble | 2 +- norg/utils/run.nim | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/norg.nimble b/norg.nimble index 4288661..f30058a 100644 --- a/norg.nimble +++ b/norg.nimble @@ -1,6 +1,6 @@ # Package -version = "0.1.12" +version = "0.1.13" author = "Paul Wilde" description = "A Borg Backup Orchestration Tool" license = "AGPL-3.0-or-later" diff --git a/norg/utils/run.nim b/norg/utils/run.nim index 974e210..307a754 100644 --- a/norg/utils/run.nim +++ b/norg/utils/run.nim @@ -5,9 +5,10 @@ import ../model/log_type proc run*(cmd: string): int = debug fmt"Trying to run : {cmd}" try: - let res = execCmd(cmd) - debug("Run Command Exist Code: " & $res) - return res + let (output,exitcode) = execCmdEx(cmd) + debug("Run Command Exist Code: " & $exitcode) + info(output) + return exitcode except: error getCurrentExceptionMsg() return 1 @@ -15,9 +16,10 @@ proc run*(cmd: string): int = proc runDiscard*(cmd: string): int = debug fmt"Trying to run : {cmd}" try: - let res = execCmd(cmd) - debug("Run Command Exist Code: " & $res) - return res + let (output,exitcode) = execCmdEx(cmd) + debug("Run Command Exist Code: " & $exitcode) + info(output) + return exitcode except: error getCurrentExceptionMsg() return 1