! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: io.files io kernel sequences assocs splitting parser
-namespaces math vocabs hashtables ;
+USING: assocs hashtables kernel math namespaces vocabs ;
IN: tools.deploy.config
SYMBOL: deploy-name
! default value for deploy.macosx
{ "stop-after-last-window?" t }
} assoc-union ;
+
+SYMBOL: deploy-directory
+"resource:" deploy-directory set-global
[ % "/Contents/Resources/" % % ".image" % ] "" make ;
: deploy-app-bundle ( vocab -- )
- [
+ deploy-directory get [
dup deploy-config [
bundle-name dup exists? [ delete-tree ] [ drop ] if
[ bundle-name create-app-dir ] keep
[ "Contents/Frameworks" copy-libraries ] 2bi
bundle-name show-in-finder
] with-variables
- ] with-resource-directory ;
+ ] with-directory ;
: deploy-app-bundle? ( vocab -- ? )
deploy-config [ deploy-console? get not deploy-ui? get or ] with-variables ;
deploy-name get ;
M: unix deploy* ( vocab -- )
- [
+ deploy-directory get [
dup deploy-config [
[ bundle-name create-app-dir ] keep
[ deployed-image-name ] keep
bundle-name normalize-path "Binary deployed to " "." surround print
bundle-name webbrowser:open-file
] with-variables
- ] with-resource-directory ;
+ ] with-directory ;
[ 2drop ] if ;
M: windows deploy*
- [
+ deploy-directory get [
dup deploy-config [
deploy-name get
{
[ nip open-in-explorer ]
} 2cleave
] with-variables
- ] with-resource-directory ;
+ ] with-directory ;