From 55fd8e7fe9a4e17d0458f6783620ab14bd06f23f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 6 Jul 2013 05:50:03 -0600 Subject: [PATCH] snapshot management: add "current" link original commit: 888ec4dae874811ad0e35299177c659e2bb53e4d --- pkgs/distro-build/manage-snapshots.rkt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/distro-build/manage-snapshots.rkt b/pkgs/distro-build/manage-snapshots.rkt index 5b6f723..b354f2d 100644 --- a/pkgs/distro-build/manage-snapshots.rkt +++ b/pkgs/distro-build/manage-snapshots.rkt @@ -26,6 +26,12 @@ (define snapshots-dir (build-path site-dir 'up)) +(define link-file (build-path snapshots-dir "current")) + +(when (link-exists? link-file) + (printf "Removing old \"current\" link\n") + (delete-file link-file)) + (define snapshots (for/list ([p (in-list (directory-list snapshots-dir))] #:when (directory-exists? (build-path snapshots-dir p))) (path-element->string p))) @@ -50,3 +56,6 @@ (a ((href ,(string-append current-snapshot "/index.html"))) ,current-snapshot)))) + +(printf "Creating \"current\" link\n") +(make-file-or-directory-link current-snapshot link-file)