whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] 01/02: Make applications restart on change
Date Wed, 27 Nov 2019 14:04:41 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit e7392e8bcb37ce6ed74a0f4a554ee7c9149261a0
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Wed Nov 27 09:01:47 2019 -0500

    Make applications restart on change
---
 config/setupmymac | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/config/setupmymac b/config/setupmymac
index 48ae8a1..d2370ed 100755
--- a/config/setupmymac
+++ b/config/setupmymac
@@ -366,7 +366,27 @@ then
   restart_apache = true
 end
 
-# Start Apache httpd
+### Make applications restart on change
+
+if Process.uid != 0
+  plist = "#{Dir.home}/Library/LaunchAgents/toucher.plist"
+  contents = File.read("#{__dir__}/toucher.plist")
+  contents[/>(.*ruby.*)</, 1] = RbConfig.ruby
+  if not File.exist?(plist) or File.read(plist) != contents
+    color "$ edit #{plist}"
+    File.write plist, contents
+
+    if `launchctl list`.include? 'org.apache.whimsy/toucher'
+      run "launchctl unload #{plist}"
+    end
+  end
+
+  if not `launchctl list`.include? 'org.apache.whimsy/toucher'
+    run "launchctl load #{plist}"
+  end
+end
+
+### Start Apache httpd
 
 if Process.uid == 0
   if not `launchctl list`.include? 'org.apache.httpd'


Mime
View raw message