OS X deploy tool cleanup
parent
a13975502c
commit
cb1959b549
|
@ -1,18 +1,16 @@
|
||||||
! Copyright (C) 2007 Slava Pestov.
|
! Copyright (C) 2007 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io io.files io.launcher kernel namespaces sequences
|
USING: io io.files io.launcher kernel namespaces sequences
|
||||||
system cocoa.plists cocoa.application tools.deploy
|
system tools.deploy tools.deploy.config assocs hashtables
|
||||||
tools.deploy.config assocs hashtables prettyprint ;
|
prettyprint unix io.unix.backend cocoa cocoa.plists
|
||||||
|
cocoa.application cocoa.classes ;
|
||||||
IN: tools.deploy.macosx
|
IN: tools.deploy.macosx
|
||||||
|
|
||||||
: touch ( path -- )
|
: touch ( path -- )
|
||||||
"touch \"" swap "\"" 3append run-process ;
|
{ "touch" } swap add run-process ;
|
||||||
|
|
||||||
: rm ( path -- )
|
: rm ( path -- )
|
||||||
"rm -rf \"" swap "\"" 3append run-process ;
|
{ "rm" "-rf" } swap add run-process ;
|
||||||
|
|
||||||
: chmod ( path perms -- )
|
|
||||||
[ "chmod " % % " \"" % % "\"" % ] "" make run-process ;
|
|
||||||
|
|
||||||
: bundle-dir ( -- dir )
|
: bundle-dir ( -- dir )
|
||||||
vm parent-directory parent-directory ;
|
vm parent-directory parent-directory ;
|
||||||
|
@ -24,7 +22,7 @@ IN: tools.deploy.macosx
|
||||||
: copy-vm ( executable bundle-name -- vm )
|
: copy-vm ( executable bundle-name -- vm )
|
||||||
"Contents/MacOS/" path+ swap path+ vm swap
|
"Contents/MacOS/" path+ swap path+ vm swap
|
||||||
[ copy-file ] keep
|
[ copy-file ] keep
|
||||||
[ "755" chmod ] keep ;
|
[ 755 chmod io-error ] keep ;
|
||||||
|
|
||||||
: copy-fonts ( name -- )
|
: copy-fonts ( name -- )
|
||||||
"fonts/" resource-path
|
"fonts/" resource-path
|
||||||
|
@ -63,6 +61,12 @@ TUPLE: macosx-deploy-implementation ;
|
||||||
|
|
||||||
T{ macosx-deploy-implementation } deploy-implementation set-global
|
T{ macosx-deploy-implementation } deploy-implementation set-global
|
||||||
|
|
||||||
|
: show-in-finder ( path -- )
|
||||||
|
NSWorkspace
|
||||||
|
-> sharedWorkspace
|
||||||
|
over <NSString> rot parent-directory <NSString>
|
||||||
|
-> selectFile:inFileViewerRootedAtPath: drop ;
|
||||||
|
|
||||||
M: macosx-deploy-implementation deploy ( vocab -- )
|
M: macosx-deploy-implementation deploy ( vocab -- )
|
||||||
".app deploy tool" assert.app
|
".app deploy tool" assert.app
|
||||||
"." resource-path cd
|
"." resource-path cd
|
||||||
|
@ -70,5 +74,6 @@ M: macosx-deploy-implementation deploy ( vocab -- )
|
||||||
bundle-name rm
|
bundle-name rm
|
||||||
[ bundle-name create-app-dir ] keep
|
[ bundle-name create-app-dir ] keep
|
||||||
[ bundle-name deploy.app-image ] keep
|
[ bundle-name deploy.app-image ] keep
|
||||||
namespace
|
namespace deploy*
|
||||||
] bind deploy* ;
|
bundle-name show-in-finder
|
||||||
|
] bind ;
|
||||||
|
|
Loading…
Reference in New Issue