diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor index af3e57336e..e7d78c1ed4 100644 --- a/basis/tools/deploy/backend/backend.factor +++ b/basis/tools/deploy/backend/backend.factor @@ -140,3 +140,5 @@ DEFER: ?make-staging-image image vm embed-image ; HOOK: deploy* os ( vocab -- ) + +HOOK: deploy-path os ( vocab -- path ) diff --git a/basis/tools/deploy/deploy-tests.factor b/basis/tools/deploy/deploy-tests.factor index b5f99dcd6f..faf58106a0 100644 --- a/basis/tools/deploy/deploy-tests.factor +++ b/basis/tools/deploy/deploy-tests.factor @@ -18,6 +18,12 @@ delete-staging-images { } [ "hello-world" shake-and-bake 550000 small-enough? ] unit-test +{ "Hello world\n" } [ + "hello-world" deploy + "hello-world" deploy-path 1array + ascii [ contents ] with-process-reader +] unit-test + { } [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test ! [ ] [ "hello-ui" shake-and-bake 1605000 small-enough? ] unit-test diff --git a/basis/tools/deploy/macosx/macosx.factor b/basis/tools/deploy/macosx/macosx.factor index 44a24fb36b..6a43e73196 100644 --- a/basis/tools/deploy/macosx/macosx.factor +++ b/basis/tools/deploy/macosx/macosx.factor @@ -92,8 +92,22 @@ IN: tools.deploy.macosx : deploy-app-bundle? ( vocab -- ? ) deploy-config [ deploy-console? get not deploy-ui? get or ] with-variables ; -M: macosx deploy* ( vocab -- ) +M: macosx deploy* ! pass off to M: unix deploy* if we're building a console app - dup deploy-app-bundle? - [ deploy-app-bundle ] - [ call-next-method ] if ; + dup deploy-app-bundle? [ + deploy-app-bundle + ] [ + call-next-method + ] if ; + +M: macosx deploy-path + dup deploy-app-bundle? [ + deploy-directory get [ + dup deploy-config [ + bundle-name "Contents/MacOS/" append-path + swap append-path normalize-path + ] with-variables + ] with-directory + ] [ + call-next-method + ] if ; diff --git a/basis/tools/deploy/unix/unix.factor b/basis/tools/deploy/unix/unix.factor index e8fd2c745b..114a9ce70d 100644 --- a/basis/tools/deploy/unix/unix.factor +++ b/basis/tools/deploy/unix/unix.factor @@ -1,8 +1,9 @@ ! Copyright (C) 2008 James Cash ! See http://factorcode.org/license.txt for BSD license. -USING: io io.backend io.directories io.files.info.unix kernel -namespaces sequences system tools.deploy.backend -tools.deploy.config tools.deploy.config.editor ; +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 ; QUALIFIED: webbrowser IN: tools.deploy.unix @@ -13,7 +14,7 @@ IN: tools.deploy.unix : bundle-name ( -- str ) deploy-name get ; -M: unix deploy* ( vocab -- ) +M: unix deploy* deploy-directory get [ dup deploy-config [ [ bundle-name create-app-dir ] keep @@ -24,3 +25,10 @@ M: unix deploy* ( vocab -- ) bundle-name webbrowser: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 ; diff --git a/basis/tools/deploy/windows/windows.factor b/basis/tools/deploy/windows/windows.factor index ca3b2203f0..16e6c571fe 100755 --- a/basis/tools/deploy/windows/windows.factor +++ b/basis/tools/deploy/windows/windows.factor @@ -40,3 +40,12 @@ M: windows deploy* } 2cleave ] with-variables ] with-directory ; + +M: windows deploy-path + deploy-directory get [ + dup deploy-config [ + deploy-name get + swap ".exe" append append-path + normalize-path + ] with-variables + ] with-directory ;