hare

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

commit 39b03bce994aac936c2ce7eb7b7665e6f5f38d9b
parent 13f3fbfa2f87c6ae1f8521ad7a28b6d02fc85c3f
Author: Alexey Yerin <yyp@disroot.org>
Date:   Tue,  7 Feb 2023 17:12:55 +0300

cmd/hare: clear the progress bar when an error happens

Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mcmd/hare/plan.ha | 1+
Mcmd/hare/schedule.ha | 4++++
2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/cmd/hare/plan.ha b/cmd/hare/plan.ha @@ -268,6 +268,7 @@ fn execute( case let cmd: exec::command => yield cmd; case let err: exec::error => + progress_clear(plan); fmt::fatalf("Error resolving {}: {}", task.cmd[0], exec::strerror(err)); }; diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha @@ -94,6 +94,7 @@ fn sched_module(plan: *plan, ident: ast::ident, link: *[]*task) *task = { let ver = match (module::lookup(plan.context, ident)) { case let err: module::error => let ident = unparse::identstr(ident); + progress_clear(plan); fmt::fatalf("Error resolving {}: {}", ident, module::strerror(err)); case let ver: module::version => @@ -296,6 +297,7 @@ fn sched_hare_object( let manifest = match (module::manifest_load( plan.context, namespace)) { case let err: module::error => + progress_clear(plan); fmt::fatalf("Error reading cache entry for {}: {}", displayed_ns, module::strerror(err)); case let m: module::manifest => @@ -318,6 +320,7 @@ fn sched_hare_object( match (os::mkdirs(path, 0o755)) { case void => void; case let err: fs::error => + progress_clear(plan); fmt::fatalf("Error: mkdirs {}: {}", path, fs::strerror(err)); }; @@ -343,6 +346,7 @@ fn sched_hare_object( }; }; if (hare_inputs == 0) { + progress_clear(plan); fmt::fatalf("Error: Module {} has no Hare input files", displayed_ns); };