]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/release/tidy/tidy.factor
io.files: exists? -> file-exists? and rename primitive.
[factor.git] / extra / mason / release / tidy / tidy.factor
1 ! Copyright (C) 2008, 2011 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: bootstrap.image io.directories io.files kernel namespaces
4 sequences system ;
5 FROM: mason.config => target-os ;
6 IN: mason.release.tidy
7
8 CONSTANT: cleanup-list {
9     "vm"
10     "temp"
11     "logs"
12     ".git"
13     ".gitignore"
14     "GNUmakefile"
15     "Nmakefile"
16     "unmaintained"
17     "build.cmd"
18     "build.sh"
19     "build-support"
20     "images"
21     "factor.dll.exp"
22     "factor.dll.lib"
23     "factor.exp"
24     "factor.lib"
25     "factor.image.fresh"
26     "libfactor-ffi-test.exp"
27     "libfactor-ffi-test.lib"
28 }
29
30 : useless-files ( -- seq )
31     cleanup-list image-names [ boot-image-name ] map append
32     target-os get macosx? [ "Factor.app" suffix ] unless ;
33
34 : tidy ( -- )
35     "factor" [
36         useless-files
37         [ file-exists? ] filter
38         [ delete-tree ] each
39     ] with-directory ;