From 91757bac8757480c60210158a5e0a3270510e07e Mon Sep 17 00:00:00 2001 From: "wjak56@gmail.com" Date: Mon, 10 Aug 2015 18:33:48 -0400 Subject: [PATCH] simplify getting the list of posts --- api.rkt | 11 ++++------- categorize.rkt | 2 ++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api.rkt b/api.rkt index 3a6d451..e88ebab 100644 --- a/api.rkt +++ b/api.rkt @@ -198,15 +198,12 @@ ; Returns a list of all modified post files in this commit (define (get-files) (map - (lambda (file) - (string-split - file - ":")) + string-split (string-split (with-output-to-string (lambda () (system - "git status --short | grep -E '^(A|M|D)' | awk '{ printf \"%s:%s\\n\",$1,$2 }' | grep -E '\\.post$'"))) + "git status --short | grep -E '\\.post$'"))) "\n"))) ; Parses a post file and returns the components @@ -237,8 +234,8 @@ ["D" (rm-post post-id)] - [m (error - (format "Unimplemented mode ~a" m))])) + [m (displayln + (format "Untracked file ~a" m))])) ; Get a list of all commit refs (define (get-commits) diff --git a/categorize.rkt b/categorize.rkt index face65f..f1ec378 100644 --- a/categorize.rkt +++ b/categorize.rkt @@ -14,6 +14,8 @@ (cons (path->string bottom) (categorize (path->string upper)))]))) +;(define (prefix-of + (define (get-categories path-string) (let ([non-categories (categorize (blog-location))]) (filter