! See http://factorcode.org/license.txt for BSD license.
USING: kernel namespaces sequences splitting system accessors
math.functions make io io.files io.pathnames io.directories
-io.launcher io.encodings.utf8 prettyprint
+io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint
combinators.short-circuit parser combinators calendar
-calendar.format arrays mason.config locals ;
+calendar.format arrays mason.config locals system ;
IN: mason.common
+HOOK: really-delete-tree os ( path -- )
+
+M: windows really-delete-tree
+ #! Workaround: Cygwin GIT creates read-only files for
+ #! some reason.
+ [ { "chmod" "ug+rw" "-R" } swap (normalize-path) suffix try-process ]
+ [ delete-tree ]
+ bi ;
+
+M: unix really-delete-tree delete-tree ;
+
: short-running-process ( command -- )
#! Give network operations at most 15 minutes to complete.
<process>
"-fs" "HFS+"
"-volname" "factor" }
archive-name suffix try-process
- "dmg-root" delete-tree ;
+ "dmg-root" really-delete-tree ;
: make-unix-archive ( -- )
[ "tar" , "-cvzf" , archive-name , "factor" , ] { } make try-process ;
append ;
: remove-common-files ( -- )
- common-files [ delete-tree ] each ;
+ common-files [ really-delete-tree ] each ;
: remove-factor-app ( -- )
target-os get "macosx" =
- [ "Factor.app" delete-tree ] unless ;
+ [ "Factor.app" really-delete-tree ] unless ;
: tidy ( -- )
"factor" [ remove-factor-app remove-common-files ] with-directory ;