Use `open-pipe*` instead of `system`
This commit is contained in:
parent
ab1490d840
commit
efde6c9003
9
mkly
9
mkly
|
@ -4,7 +4,8 @@
|
|||
(ice-9 match)
|
||||
(srfi srfi-1)
|
||||
(ice-9 format)
|
||||
(ice-9 regex))
|
||||
(ice-9 regex)
|
||||
(ice-9 popen))
|
||||
|
||||
;; If ARG is truthy, return "-<ARG>", else return "".
|
||||
(define (file-name-part arg)
|
||||
|
@ -13,7 +14,11 @@
|
|||
;; Return the current branch of the project's version control system.
|
||||
(define (vcs-current-branch)
|
||||
(cond ((file-exists? ".git")
|
||||
(system "git rev-parse --abbrev-ref HEAD"))
|
||||
(let* ((port (open-pipe* "open_read"
|
||||
"git" "rev-parse" "--abbrev-ref" "HEAD"))
|
||||
(output (read-line port)))
|
||||
(close-pipe port)
|
||||
output))
|
||||
(else (error "Could not find a version control system"))))
|
||||
|
||||
(define (flatten seq)
|
||||
|
|
Loading…
Reference in New Issue