kestrel: style cleanup

This commit is contained in:
Dominyk Tiller 2016-07-26 00:13:48 +01:00
parent 45ecac0d98
commit e2f9f87936
No known key found for this signature in database
GPG key ID: FE19AEFCF658C6F6

View file

@ -9,37 +9,33 @@ class Kestrel < Formula
def install
inreplace "scripts/kestrel.sh" do |s|
s.change_make_var! "APP_HOME", libexec
# Fix var paths.
s.gsub! "/var/", "/#{var}/"
s.gsub! "/var", var
# Fix path to script in help message.
s.gsub! "Usage: /etc/init.d/${APP_NAME}.sh", "Usage: kestrel"
# Don't call ulimit as not root.
s.gsub! "ulimit -", "# ulimit -"
end
inreplace "config/production.scala" do |s|
# Fix var paths.
s.gsub! "/var/", "/#{var}/"
end
inreplace "config/production.scala", "/var", var
libexec.install Dir["*"]
(libexec/"scripts/kestrel.sh").chmod 0755
(libexec/"scripts/devel.sh").chmod 0755
(var/"log/kestrel").mkpath
(var/"run/kestrel").mkpath
(var/"spool/kestrel").mkpath
(bin/"kestrel").write <<-EOS.undent
#!/bin/bash
exec "#{libexec}/scripts/kestrel.sh" "$@"
EOS
end
def post_install
(var/"log/kestrel").mkpath
(var/"run/kestrel").mkpath
(var/"spool/kestrel").mkpath
end
test do
system "#{bin}/kestrel", "status"
system bin/"kestrel", "status"
end
end