]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/cleanup/cleanup.factor
io.files: exists? -> file-exists? and rename primitive.
[factor.git] / extra / mason / cleanup / cleanup.factor
1 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
2 ! See http://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     dup file-exists? [
9         "bzip2" swap 2array short-running-process
10     ] [ drop ] if ;
11
12 : compress-image ( -- )
13     target-boot-image-name compress ;
14
15 : compress-test-log ( -- )
16     "test-log" compress ;
17
18 : cleanup-build ( -- )
19     builder-debug get [
20         build-dir [
21             compress-image
22             compress-test-log
23             "factor" delete-tree
24         ] with-directory
25     ] unless ;