Skip to content

Instantly share code, notes, and snippets.

@rnewson
Created July 21, 2014 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnewson/1fcf7915d998ae89e34b to your computer and use it in GitHub Desktop.
Save rnewson/1fcf7915d998ae89e34b to your computer and use it in GitHub Desktop.
overwrite default.ini after install
diff --git a/Library/Formula/couchdb.rb b/Library/Formula/couchdb.rb
index c77e70c..258140b 100644
--- a/Library/Formula/couchdb.rb
+++ b/Library/Formula/couchdb.rb
@@ -59,6 +59,25 @@ class Couchdb < Formula
(var+'log/couchdb').mkpath
end
+ def post_install
+ if new_default_ini.exist?
+ mv default_ini, old_default_ini
+ mv new_default_ini, default_ini
+ end
+ end
+
+ def default_ini
+ "#{etc}/couchdb/default.ini"
+ end
+
+ def new_default_ini
+ "#{etc}/couchdb/default.ini.default"
+ end
+
+ def old_default_ini
+ "#{etc}/couchdb/default.ini.old"
+ end
+
plist_options :manual => "couchdb"
def plist; <<-EOS.undent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment