From c93dcdd37461d2fe79febfd5004e172787fb32f5 Mon Sep 17 00:00:00 2001 From: Cristian Esquivias Date: Sat, 9 Aug 2014 12:50:26 -0700 Subject: [PATCH] Simple do function to spawn processes. --- rash.rkt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 rash.rkt diff --git a/rash.rkt b/rash.rkt new file mode 100644 index 0000000..bee2fcf --- /dev/null +++ b/rash.rkt @@ -0,0 +1,16 @@ +#lang racket/base + +(require readline/readline) +(require racket/string) + +(define (do command . args) + (let ([cmd (find-executable-path command)]) + (if cmd + (let-values ([(subproc in out err) + (subprocess (current-output-port) + (current-input-port) + (current-error-port) + cmd + (string-join args " "))]) + (subprocess-wait subproc)) + (raise (exn:fail:filesystem command)))))