]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/release/tidy/tidy.factor
58046ce64c9050a2fc559c997fbde54408f556d3
[factor.git] / extra / mason / release / tidy / tidy.factor
1 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: bootstrap.image continuations debugger fry
4 io.directories io.directories.hierarchy io.files io.launcher
5 kernel mason.common namespaces qualified sequences ;
6 FROM: mason.config => target-os ;
7 IN: mason.release.tidy
8
9 : common-files ( -- seq )
10     images [ boot-image-name ] map
11     {
12         "vm"
13         "temp"
14         "logs"
15         ".git"
16         ".gitignore"
17         "Makefile"
18         "unmaintained"
19         "unfinished"
20         "build-support"
21     }
22     append ;
23
24 : remove-common-files ( -- )
25     common-files [ delete-tree ] each ;
26
27 : remove-factor-app ( -- )
28     target-os get "macosx" =
29     [ "Factor.app" delete-tree ] unless ;
30
31 : tidy ( -- )
32     "factor" [ remove-factor-app remove-common-files ] with-directory ;