This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new dffb0ecd Another Docker reference
dffb0ecd is described below
commit dffb0ecdf7e4e43145625caeeb0ea3d97f5e5ee5
Author: Sebb <[email protected]>
AuthorDate: Tue Apr 23 13:11:41 2024 +0100
Another Docker reference
---
config/setupmymac | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/config/setupmymac b/config/setupmymac
index 1115eb1b..d574f63c 100755
--- a/config/setupmymac
+++ b/config/setupmymac
@@ -82,6 +82,15 @@ def sudo
end
end
+def findDocker
+ if Dir.exist? "#{Dir.home}/Applications/Docker.app"
+ return "#{Dir.home}/Applications/Docker.app"
+ elsif Dir.exist? '/Applications/Docker.app'
+ return '/Applications/Docker.app'
+ end
+ return nil
+end
+
### Parse options to determine how whimsy code is to be run
option = :www
@@ -178,7 +187,7 @@ sudo_user = ENV['SUDO_USER'] ?
### Install Homebrew
-unless $root and (option != :docker or not Dir.exist?
'/Applications/Docker.app')
+unless $root and (option != :docker or not findDocker)
if `which brew`.empty?
script =
'https://raw.githubusercontent.com/Homebrew/install/master/install'
color %($ ruby -e "$(curl -fsSL #{script})")
@@ -334,12 +343,7 @@ if force[:prune]
end
if option == :docker
- dockerapp = nil
- if Dir.exist? "#{Dir.home}/Applications/Docker.app"
- dockerapp = "#{Dir.home}/Applications/Docker.app"
- elsif Dir.exist? '/Applications/Docker.app'
- dockerapp = '/Applications/Docker.app'
- end
+ dockerapp = findDocker
unless dockerapp
dockerapp = '/Applications/Docker.app'
brew 'cask', 'install', 'docker'