factor/basis/tools/deploy/unix/unix.factor

37 lines
1.1 KiB
Factor
Raw Normal View History

! Copyright (C) 2008 James Cash
! See http://factorcode.org/license.txt for BSD license.
USING: io io.backend io.directories io.files.info.unix
io.pathnames kernel namespaces sequences system
tools.deploy.backend tools.deploy.config
tools.deploy.config.editor webbrowser ;
2008-04-20 01:49:42 -04:00
IN: tools.deploy.unix
2008-04-11 14:28:28 -04:00
2008-04-20 01:49:42 -04:00
: create-app-dir ( vocab bundle-name -- vm )
copy-vm
2011-11-23 21:49:33 -05:00
dup 0o755 set-file-permissions ;
2008-04-20 01:49:42 -04:00
: bundle-name ( -- str )
deploy-name get ;
: ?open-file ( path -- )
open-directory-after-deploy? get [ open-file ] [ drop ] if ;
M: unix deploy*
deploy-directory get [
2008-04-20 01:49:42 -04:00
dup deploy-config [
[ bundle-name create-app-dir ] keep
[ deployed-image-name ] keep
namespace make-deploy-image-executable
bundle-name "" [ copy-resources ] [ copy-libraries ] 3bi
bundle-name normalize-path "Binary deployed to " "." surround print
bundle-name ?open-file
] with-variables
] with-directory ;
M: unix deploy-path
deploy-directory get [
dup deploy-config [
bundle-name swap append-path normalize-path
] with-variables
] with-directory ;