Install handler in CALL-TERMINALLY so scsh with exit with status 1 in case of an error.
This commit is contained in:
parent
bcbd16ff0a
commit
622ef7a99f
|
@ -232,6 +232,7 @@
|
||||||
general-tables
|
general-tables
|
||||||
simple-syntax
|
simple-syntax
|
||||||
exit-hooks
|
exit-hooks
|
||||||
|
display-conditions
|
||||||
|
|
||||||
scsh-endian)
|
scsh-endian)
|
||||||
(for-syntax (open scsh-syntax-helpers scheme))
|
(for-syntax (open scsh-syntax-helpers scheme))
|
||||||
|
|
|
@ -9,11 +9,16 @@
|
||||||
(define (call-terminally thunk)
|
(define (call-terminally thunk)
|
||||||
(with-continuation
|
(with-continuation
|
||||||
null-continuation
|
null-continuation
|
||||||
|
(lambda ()
|
||||||
|
(with-handler
|
||||||
|
(lambda (c more)
|
||||||
|
(display-condition c (current-error-port))
|
||||||
|
(exit 1))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(dynamic-wind
|
(dynamic-wind
|
||||||
(lambda () (values))
|
(lambda () (values))
|
||||||
thunk
|
thunk
|
||||||
(lambda () (exit 0))))))
|
(lambda () (exit 0))))))))
|
||||||
|
|
||||||
;; from shift-reset.scm:
|
;; from shift-reset.scm:
|
||||||
(define null-continuation #f)
|
(define null-continuation #f)
|
||||||
|
|
Loading…
Reference in New Issue