failsafe if "which" is not executable.
This commit is contained in:
parent
2d7a37f060
commit
945b4a2ade
|
@ -11,6 +11,7 @@
|
|||
let-opt
|
||||
receiving
|
||||
primitives
|
||||
handle-fatal-error
|
||||
)
|
||||
(begin
|
||||
|
||||
|
@ -310,10 +311,13 @@ plot '~a' title 'SUrflet Profiling ~a' with lines"
|
|||
(profile req))
|
||||
|
||||
(define (search-executable exec-name)
|
||||
(receive (status ports) (run/collecting (1) (which ,exec-name))
|
||||
(if (zero? status)
|
||||
(read-line ports)
|
||||
"")))
|
||||
(with-fatal-error-handler
|
||||
;; If `which' is unavailable, return nothing.
|
||||
(lambda (condition decline) "")
|
||||
(receive (status ports) (run/collecting (1) (which ,exec-name))
|
||||
(if (zero? status)
|
||||
(read-line ports)
|
||||
""))))
|
||||
|
||||
(define (emph text)
|
||||
`(font (@ (color "red")) ,text))
|
||||
|
@ -327,5 +331,4 @@ plot '~a' title 'SUrflet Profiling ~a' with lines"
|
|||
`(tr (td (@ (colspan 2))
|
||||
,(emph "Note: There is no executable."))))))
|
||||
|
||||
;; TODO: check `where' tool
|
||||
))
|
Loading…
Reference in New Issue