Skip to content

Commit

Permalink
script - cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Dec 7, 2023
1 parent ce79d99 commit b21d099
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions script/cleanup-checkout-cache.scm
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

;; regular expression for matching an URL
(define regexp "\\(https\\|http\\|file\\)\\?://[^ ]\\+")
;; (format #t "[DEBUG] regexp:\n~a\n" regexp)
;; (format #t "[DEBUG] regexp: ~a\n" regexp)

(define (read-all-strings port)
"Return a list of all lines of text from the PORT.
Returns a list of strings."
(let loop ((res '())
(str (read-line port))) ; read-line is from (ice-9 rdelim)
(str (read-line port))) ; read-line from (ice-9 rdelim)
(if (and str (not (eof-object? str)))
(loop (append res (list str))
(read-line port))
Expand All @@ -35,8 +35,8 @@ Returns a list of strings."
from the subprocess. Wait for the command to terminate and return a string
containing its output."
;; (format #t "[DEBUG] command: ~a\n" command)
(let* ((port (open-input-pipe command)) ; open-input-pipe is from (ice-9 popen)
;; the `read-all-strings' must be called before `close-pipe'.
(let* ((port (open-input-pipe command)) ; open-input-pipe from (ice-9 popen)
;; `read-all-strings' must be called before `close-pipe'.
(results (read-all-strings port)))
(close-pipe port) ;; the return code of the command execution is ignored
results))
Expand Down Expand Up @@ -119,5 +119,3 @@ containing its output."
nonGitRepos)
(for-each (lambda (ndir) (format #t "~a\n" ndir))
cacheNonDirs)))

(exit 0)

0 comments on commit b21d099

Please sign in to comment.