From f0600ac3712c4cbf7ace0f8608c8a21c7a579e84 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 17 Aug 2015 12:40:05 -0700 Subject: [PATCH] add `raco pollen reset` for compile cache --- command.rkt | 7 +++++++ scribblings/raco.scrbl | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/command.rkt b/command.rkt index 66dc2f3..17bf23b 100644 --- a/command.rkt +++ b/command.rkt @@ -28,6 +28,7 @@ ;; "second" arg is actually third in command line args, so use cddr not cdr [("render") (handle-render (cons (get-first-arg-or-current-dir) (map very-nice-path (cddr (vector->list (current-command-line-arguments))))))] [("version") (handle-version)] + [("reset") (handle-reset)] [("clone" "publish") (define rest-args (with-handlers ([exn:fail? (λ _ #f)]) (cddr (vector->list (current-command-line-arguments))))) @@ -51,12 +52,18 @@ render filename render filename only (can be source or output name) publish copy project to desktop without source files publish [dir] [dest] copy project in dir to dest without source files (warning: overwrites existing dest dir) +reset reset compile cache version print the version (~a)" (world:current-server-port) (world:current-pollen-version)))) (define (handle-version) (displayln (world:current-pollen-version))) +(define (handle-reset) + (display "Resetting cache ...") + ((dynamic-require 'pollen/cache 'reset-cache)) + (displayln " done")) + (define (handle-render path-args) (parameterize ([current-directory (world:current-project-root)]) diff --git a/scribblings/raco.scrbl b/scribblings/raco.scrbl index f6eb777..f770a66 100644 --- a/scribblings/raco.scrbl +++ b/scribblings/raco.scrbl @@ -93,6 +93,10 @@ Make a copy of the project directory on the desktop, but without any source file If you're already in your project directory and want to publish somewhere other than the desktop, use @racket[raco pollen publish _. _dest-dir]. +@section{@racket[raco pollen reset]} + +Resets Pollen's compile cache. Resetting does not delete the compile cache, but rather just zeroes out the cache database. On the next run, obsolete cache files will be deleted. + @section{@racket[raco pollen version]} Would you believe this prints the Pollen version number.