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
The following commit(s) were added to refs/heads/master by this push:
new 8ac517e chown /srv
8ac517e is described below
commit 8ac517e09486f8f1d5d7142a52f9f84011c35f14
Author: Sam Ruby <[email protected]>
AuthorDate: Sun Nov 24 15:49:11 2019 -0500
chown /srv
---
config/setupmymac | 3 +++
1 file changed, 3 insertions(+)
diff --git a/config/setupmymac b/config/setupmymac
index 33ed350..e9942f1 100755
--- a/config/setupmymac
+++ b/config/setupmymac
@@ -108,10 +108,12 @@ end
mac_version = `sw_vers`[/ProductVersion:\s+(.*)/, 1]
unless Dir.exist? '/srv'
+ group = `id #{ENV['SUDO_USER']}`[/gid=\d+\((\w+)\)/, 1]
sudo do
if (mac_version.split('.').map(&:to_i) <=> [10, 15, 0]) >= 0
# Catalina or later
Dir.mkdir '/var/whimsy' unless Dir.exist? '/var/whimsy'
+ FileUtils.chown ENV['SUDO_USER'], group, '/var/whimsy'
FileUtils.touch '/etc/synthetic.conf'
SYNTHETIC = '/etc/synthetic.conf'
unless File.read(SYNTHETIC).inslude? "/var/whimsy"
@@ -122,6 +124,7 @@ unless Dir.exist? '/srv'
else
# prior to Catalina
Dir.mkdir '/srv'
+ FileUtils.chown ENV['SUDO_USER'], group, '/srv'
end
end
end