diff options
author | Ben Sima <ben@bsima.me> | 2019-11-01 14:24:24 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-11-01 14:25:49 -0700 |
commit | 9756eb0806aef63137ed53c7f78eee13aa3db9d7 (patch) | |
tree | 0c3bf0becc08e37386109ff8c518fa442df6266b /com/simatime/bild.scm | |
parent | 0a6fd40946f72e9995ca04b05d7556bf20585d4f (diff) |
add buildHaskellApp nix function
Diffstat (limited to 'com/simatime/bild.scm')
-rwxr-xr-x | com/simatime/bild.scm | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/com/simatime/bild.scm b/com/simatime/bild.scm index 604a545..44f6c74 100755 --- a/com/simatime/bild.scm +++ b/com/simatime/bild.scm @@ -122,6 +122,9 @@ exec guile -e "(@ (com simatime bild) main)" -s "$0" "$@" (define-module (com simatime bild) #:use-module ((ice-9 popen) #:prefix popen/) #:use-module ((ice-9 format) #:select (format)) + #:use-module ((ice-9 rdelim) #:prefix rdelim/) + #:use-module ((com simatime shell) #:prefix sh/) + #:use-module ((com simatime string) #:prefix string/) #:export (ns? ns->path path->ns @@ -156,24 +159,3 @@ exec guile -e "(@ (com simatime bild) main)" -s "$0" "$@" ((symbol? path) (to-ns (symbol->string path))) ((string? path) (to-ns path)) (else (error "path should be a string or symbol"))))) - - -;; -;; general funs, to be moved to a core lib -;; - -(define (string/replace s match replacement) - (string-fold - (lambda (a b) - (let ((next-char (if (eq? a match) - replacement - a))) - (string-concatenate (list b (string next-char))))) - "" - s)) - -(define (sh/exec cmd) - (let* ((port (popen/open-input-pipe cmd)) - (ret (read port))) - (popen/close-pipe port) - ret)) |