diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor index e7d78c1ed4..8c21fafbb2 100644 --- a/basis/tools/deploy/backend/backend.factor +++ b/basis/tools/deploy/backend/backend.factor @@ -139,6 +139,9 @@ DEFER: ?make-staging-image vm image vocab config make-deploy-image image vm embed-image ; +SYMBOL: open-directory-after-deploy? +t open-directory-after-deploy? set-global + 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 faf58106a0..a103c4d33e 100644 --- a/basis/tools/deploy/deploy-tests.factor +++ b/basis/tools/deploy/deploy-tests.factor @@ -19,9 +19,11 @@ 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 + f open-directory-after-deploy? [ + "hello-world" deploy + "hello-world" deploy-path 1array + ascii [ contents ] with-process-reader + ] with-variable ] unit-test { } [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test diff --git a/basis/tools/deploy/macosx/macosx.factor b/basis/tools/deploy/macosx/macosx.factor index 6a43e73196..2dcf465ef0 100644 --- a/basis/tools/deploy/macosx/macosx.factor +++ b/basis/tools/deploy/macosx/macosx.factor @@ -72,6 +72,9 @@ IN: tools.deploy.macosx [ normalize-path [ ] [ parent-directory ] bi ] bi* -> selectFile:inFileViewerRootedAtPath: drop ; +: ?show-in-finder ( path -- ) + open-directory-after-deploy? get [ show-in-finder ] [ drop ] if ; + : deploy.app-image-name ( vocab bundle-name -- str ) [ % "/Contents/Resources/" % % ".image" % ] "" make ; @@ -85,7 +88,7 @@ IN: tools.deploy.macosx bundle-name [ "Contents/Resources" copy-resources ] [ "Contents/Frameworks" copy-libraries ] 2bi - bundle-name show-in-finder + bundle-name ?show-in-finder ] with-variables ] with-directory ; diff --git a/basis/tools/deploy/unix/unix.factor b/basis/tools/deploy/unix/unix.factor index 114a9ce70d..a288408da8 100644 --- a/basis/tools/deploy/unix/unix.factor +++ b/basis/tools/deploy/unix/unix.factor @@ -3,8 +3,7 @@ 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 +tools.deploy.config.editor webbrowser ; IN: tools.deploy.unix : create-app-dir ( vocab bundle-name -- vm ) @@ -14,6 +13,9 @@ IN: tools.deploy.unix : bundle-name ( -- str ) deploy-name get ; +: ?open-file ( path -- ) + open-directory-after-deploy? get [ open-file ] [ drop ] if ; + M: unix deploy* deploy-directory get [ dup deploy-config [ @@ -22,7 +24,7 @@ M: unix deploy* namespace make-deploy-image-executable bundle-name "" [ copy-resources ] [ copy-libraries ] 3bi bundle-name normalize-path "Binary deployed to " "." surround print - bundle-name webbrowser:open-file + bundle-name ?open-file ] with-variables ] with-directory ; diff --git a/basis/tools/deploy/windows/windows.factor b/basis/tools/deploy/windows/windows.factor index 6a6cf3f933..24f353e1b3 100755 --- a/basis/tools/deploy/windows/windows.factor +++ b/basis/tools/deploy/windows/windows.factor @@ -22,6 +22,9 @@ CONSTANT: app-icon-resource-id "APPICON" [ f "open" ] dip absolute-path normalize-separators f f SW_SHOWNORMAL ShellExecute drop ; +: ?open-in-explorer ( dir -- ) + open-directory-after-deploy? get [ open-in-explorer ] [ drop ] if ; + : embed-ico ( vm-path vocab -- ) dup vocab-windows-icon-path vocab-append-path dup exists? [ binary file-contents app-icon-resource-id embed-icon-resource ] @@ -37,7 +40,7 @@ M: windows deploy* [ drop deployed-image-name ] [ drop namespace make-deploy-image-executable ] [ nip "" [ copy-resources ] [ copy-libraries ] 3bi ] - [ nip open-in-explorer ] + [ nip ?open-in-explorer ] } 2cleave ] with-variables ] with-directory ;