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

35 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 io.files.info.unix
io.pathnames kernel namespaces sequences system
tools.deploy.backend tools.deploy.config
tools.deploy.config.editor vocabs.loader vocabs.metadata ;
2008-04-20 01:49:42 -04:00
IN: tools.deploy.unix
2008-04-11 14:28:28 -04:00
: used-icon ( vocab -- ico )
dup vocab-dir "icon.png" append-path vocab-append-path
[ exists? ] keep "vocab:ui/backend/gtk/icon.png" ? ;
: copy-icon ( vocab bundle-name -- )
[ used-icon ]
[ "ui/backend/gtk/icon.png" append-path ] bi*
copy-file ;
2008-04-20 01:49:42 -04:00
: create-app-dir ( vocab bundle-name -- vm )
[ copy-vm ] [ copy-icon ] 2bi
dup OCT: 755 set-file-permissions ;
2008-04-20 01:49:42 -04:00
: bundle-name ( -- str )
deploy-name get ;
M: unix deploy* ( vocab -- )
"resource:" [
2008-04-20 01:49:42 -04:00
dup deploy-config [
[ bundle-name create-app-dir ] keep
[ bundle-name image-name ] keep
namespace make-deploy-image
bundle-name "" [ copy-resources ] [ copy-libraries ] 3bi
bundle-name normalize-path "Binary deployed to " "." surround print
2008-04-20 01:49:42 -04:00
] bind
] with-directory ;