hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit cb9b5872b39999f26ae57a994a3d932e449f89dd
parent c0cd6193d3bde990525f19d3cbe669ac2130e39c
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 24 Apr 2022 11:27:01 +0200

cmd/hare: print details on exec::cmd failure

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mcmd/hare/plan.ha | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cmd/hare/plan.ha b/cmd/hare/plan.ha @@ -244,7 +244,13 @@ fn execute( fmt::errorln()!; }; - let cmd = exec::cmd(task.cmd[0], task.cmd[1..]...)!; + let cmd = match (exec::cmd(task.cmd[0], task.cmd[1..]...)) { + case let cmd: exec::command => + yield cmd; + case let err: exec::error => + fmt::fatal("Error resolving {}: {}", task.cmd[0], + exec::strerror(err)); + }; for (let i = 0z; i < len(plan.environ); i += 1) { let e = plan.environ[i]; exec::setenv(&cmd, e.0, e.1);