From 0b460c431b3eb2c5cffc84dae34cc2cadf203dcb Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 23 Dec 2014 08:56:05 -0800 Subject: [PATCH] tools.deploy.backend: add word for deleting cached staging images. --- basis/tools/deploy/backend/backend.factor | 7 +++++++ basis/tools/deploy/deploy-tests.factor | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor index 6ab4de3bd2..196107ccb5 100644 --- a/basis/tools/deploy/backend/backend.factor +++ b/basis/tools/deploy/backend/backend.factor @@ -65,6 +65,13 @@ ERROR: can't-deploy-library-file library ; "-" join "." my-arch 3append "staging." ".image" surround cache-file ; +: delete-staging-images ( -- ) + cache-directory [ + [ "staging." head? ] filter + "." my-arch ".image" 3append [ tail? ] curry filter + [ delete-file ] each + ] with-directory-files ; + : staging-command-line ( profile -- flags ) [ [ diff --git a/basis/tools/deploy/deploy-tests.factor b/basis/tools/deploy/deploy-tests.factor index 7c6e5573af..e1b3796254 100644 --- a/basis/tools/deploy/deploy-tests.factor +++ b/basis/tools/deploy/deploy-tests.factor @@ -10,11 +10,7 @@ IN: tools.deploy.tests ! Delete all cached staging images in case syntax or ! other core vocabularies have changed and staging ! images are stale. -cache-directory [ - [ "staging." head? ] filter - my-arch ".image" append [ tail? ] curry filter - [ delete-file ] each -] with-directory-files +delete-staging-images [ "nosuchvocab" deploy ] [ no-vocab? ] must-fail-with