Browse Source

simplify getting the list of posts

master
wjak56@gmail.com 9 years ago
parent
commit
91757bac87
  1. 11
      api.rkt
  2. 2
      categorize.rkt

11
api.rkt

@ -198,15 +198,12 @@
; Returns a list of all modified post files in this commit ; Returns a list of all modified post files in this commit
(define (get-files) (define (get-files)
(map (map
(lambda (file) string-split
(string-split
file
":"))
(string-split (string-split
(with-output-to-string (with-output-to-string
(lambda () (lambda ()
(system (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"))) "\n")))
; Parses a post file and returns the components ; Parses a post file and returns the components
@ -237,8 +234,8 @@
["D" (rm-post post-id)] ["D" (rm-post post-id)]
[m (error [m (displayln
(format "Unimplemented mode ~a" m))])) (format "Untracked file ~a" m))]))
; Get a list of all commit refs ; Get a list of all commit refs
(define (get-commits) (define (get-commits)

2
categorize.rkt

@ -14,6 +14,8 @@
(cons (path->string bottom) (cons (path->string bottom)
(categorize (path->string upper)))]))) (categorize (path->string upper)))])))
;(define (prefix-of
(define (get-categories path-string) (define (get-categories path-string)
(let ([non-categories (categorize (blog-location))]) (let ([non-categories (categorize (blog-location))])
(filter (filter

Loading…
Cancel
Save