2010-07-05 23:41:27 -04:00
|
|
|
! Copyright (C) 2007, 2010 Slava Pestov.
|
2007-09-20 18:09:08 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2016-08-20 23:29:24 -04:00
|
|
|
USING: combinators command-line io.directories kernel namespaces
|
|
|
|
sequences system tools.deploy.backend tools.deploy.config
|
|
|
|
tools.deploy.config.editor vocabs vocabs.loader ;
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: tools.deploy
|
|
|
|
|
2012-07-22 16:24:25 -04:00
|
|
|
ERROR: no-vocab-main vocab ;
|
|
|
|
|
|
|
|
: check-vocab-main ( vocab -- vocab )
|
2015-08-13 19:13:05 -04:00
|
|
|
[ require ] keep dup vocab-main [ no-vocab-main ] unless ;
|
2012-07-22 16:24:25 -04:00
|
|
|
|
2010-07-05 23:41:27 -04:00
|
|
|
: deploy ( vocab -- )
|
2016-08-20 23:29:24 -04:00
|
|
|
dup find-vocab-root [ no-vocab ] unless
|
|
|
|
check-vocab-main
|
|
|
|
deploy-directory get [
|
|
|
|
dup deploy-config [
|
|
|
|
deploy*
|
|
|
|
] with-variables
|
|
|
|
] with-directory ;
|
2007-11-05 00:45:02 -05:00
|
|
|
|
2015-06-29 19:43:15 -04:00
|
|
|
: deploy-image-only ( vocab image -- )
|
2015-07-20 03:03:00 -04:00
|
|
|
[ vm-path ] 2dip
|
2011-09-06 19:29:15 -04:00
|
|
|
swap dup deploy-config make-deploy-image drop ;
|
2010-04-01 18:11:52 -04:00
|
|
|
|
2008-04-20 01:49:42 -04:00
|
|
|
{
|
|
|
|
{ [ os macosx? ] [ "tools.deploy.macosx" ] }
|
2011-09-18 21:25:06 -04:00
|
|
|
{ [ os windows? ] [ "tools.deploy.windows" ] }
|
2008-04-20 01:49:42 -04:00
|
|
|
{ [ os unix? ] [ "tools.deploy.unix" ] }
|
2010-04-01 18:11:52 -04:00
|
|
|
} cond require
|
2015-12-26 00:11:21 -05:00
|
|
|
|
|
|
|
: deploy-main ( -- )
|
|
|
|
command-line get [ [ require ] [ deploy ] bi ] each ;
|
|
|
|
|
|
|
|
MAIN: deploy-main
|