From 6bb62979fde5a126e0f22f0430b795aefc71ce0d Mon Sep 17 00:00:00 2001 From: Lockywolf Date: Wed, 24 Aug 2022 13:17:37 +0800 Subject: [PATCH] Make (shell) in (chibi shell) return exit status of last command. --- lib/chibi/shell.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/chibi/shell.scm b/lib/chibi/shell.scm index b70eda20..c18afa2b 100644 --- a/lib/chibi/shell.scm +++ b/lib/chibi/shell.scm @@ -494,10 +494,11 @@ (lambda () #f) (lambda () #f))))) +;;> Returns the exit status of the last command in the pipeline. (define-syntax shell (syntax-rules () ((shell cmd ...) - (for-each shell-wait (shell& cmd ...))))) + (map shell-wait (shell& cmd ...))))) (define-syntax shell->string (syntax-rules ()