]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/cleanup/cleanup.factor
io.files: using some of the new file-exists combinators
[factor.git] / extra / mason / cleanup / cleanup.factor
1 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: arrays io.directories io.files kernel mason.common
4 mason.config mason.platform namespaces ;
5 IN: mason.cleanup
6
7 : compress ( filename -- )
8     [ "bzip2" swap 2array short-running-process ] when-file-exists ;
9
10 : compress-image ( -- )
11     target-boot-image-name compress ;
12
13 : compress-test-log ( -- )
14     "test-log" compress ;
15
16 : cleanup-build ( -- )
17     builder-debug get [
18         build-dir [
19             compress-image
20             compress-test-log
21             "factor" delete-tree
22         ] with-directory
23     ] unless ;