From 599aa8697208a507c767225d8811df42fa5969be Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 30 Nov 2020 20:07:01 -0300 Subject: vps.scm: Add tick-cmd-reader for #´cmd args1 args2 $variable´ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sync/vps.scm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'sync/vps.scm') diff --git a/sync/vps.scm b/sync/vps.scm index 8a4aa71..5ab0ff6 100644 --- a/sync/vps.scm +++ b/sync/vps.scm @@ -114,6 +114,17 @@ (read-hash-extend #\[ lambda-shorthand-reader) +(define (tick-cmd-reader _char port) + (cons 'cmd + (map (lambda (s) + (if (equal? #\$ (string-ref s 0)) + (string->symbol (substring s 1)) + s)) + (string-split (rdelim:read-delimited "´" port) + #\space)))) + +(read-hash-extend #\´ tick-cmd-reader) + (define-macro (-> x . sexps) (srfi-1:fold (lambda (el acc) @@ -183,21 +194,21 @@ (define (ci-data-in-repo-notes name path) (utils:with-directory-excursion path - (let* ((out-list (-> (cmd "git" "notes" "list") + (let* ((out-list (-> #´git notes list´ (string-fun:string-replace-substring "\n" " ") (string-split #\space))) (relevant-commits (->> (srfi-1:zip out-list (iota (length out-list))) (filter (compose odd? srfi-1:second)) (map srfi-1:first)))) (map (lambda (commit) - (let ((data (-> (cmd "git" "notes" "--ref=refs/notes/ci-data" "show" commit) + (let ((data (-> #´git notes --ref=refs/notes/ci-data show $commit´ (string-split #\space))) - (logs (cmd "git" "notes" "--ref=refs/notes/ci-logs" "show" commit)) + (logs #´git notes --ref=refs/notes/ci-logs show $commit´) (href (format #f "https://~a/~a/blob?id=~a" git-domain name - (cmd "git" "notes" "--ref=refs/notes/ci-logs" "list" commit)))) + #´git notes --ref=refs/notes/ci-logs list $commit´))) (list (cons #:status (srfi-1:first data)) (cons #:filename (srfi-1:second data)) (cons #:logs logs) -- cgit v1.2.3