deleting static s3 content properly

This commit is contained in:
Jay McCarthy 2013-11-27 15:30:42 -07:00
parent cf1755fc17
commit 98df30ca2d

View File

@ -304,7 +304,16 @@
(cache "/pkgs" "pkgs")
(cache "/pkgs-all" "pkgs-all")
(for ([p (in-list pkg-list)])
(cache (format "/pkg/~a" p) (format "pkg/~a" p))))
(cache (format "/pkg/~a" p) (format "pkg/~a" p)))
(let ()
(define pkg-path (build-path static-path "pkg"))
(for ([f (in-list (directory-list pkg-path))]
#:unless (regexp-match #"json$" (path->string f))
#:unless (member (path->string f) pkg-list))
(with-handlers ([exn:fail:filesystem? void])
(delete-file (build-path pkg-path f))
(delete-file (build-path pkg-path (path-add-suffix f #".json")))))))
(module+ main
(require racket/cmdline)