Process the return value of built-ins
* geesh/shell.scm (sh:exec-let): Set the '$?' variable to the return value of built-in utilities.
This commit is contained in:
parent
21b862d326
commit
fb493cc5f4
|
@ -95,12 +95,14 @@ it cannot be found, return @code{#f}."
|
|||
((name . value)
|
||||
(set-var! env name value)))
|
||||
bindings)
|
||||
(apply proc env args)))
|
||||
(let ((exit-val (apply proc env args)))
|
||||
(set-var! env "?" (number->string exit-val)))))
|
||||
;; TODO: Functions.
|
||||
(and=> (search-built-ins name)
|
||||
(lambda (proc)
|
||||
;; TODO: Use 'bindings' here.
|
||||
(apply proc env args)))
|
||||
(let ((exit-val (apply proc env args)))
|
||||
(set-var! env "?" (number->string exit-val)))))
|
||||
(and=> (find-utility env name)
|
||||
(lambda (path)
|
||||
(exec-utility env bindings path name args)))
|
||||
|
|
Loading…
Reference in New Issue