Skip to content
Browse files

Look for `couchdb` in PATH, not hardcode to `/usr/local/bin

  • Loading branch information...
1 parent 9f24a6b commit 5eae3a6d6ab19839bcf2d81931cfd7cca60ea9d5 @janl janl committed Apr 11, 2013
Showing with 5 additions and 3 deletions.
  1. +2 −1 lib/multicouch.js
  2. +3 −2 package.json
View
3 lib/multicouch.js
@@ -2,6 +2,7 @@ var events = require("events");
var util = require("util");
var fs = require("fs");
var spawn = require("child_process").spawn;
+var which = require("which").sync;
function MultiCouch(args) {
events.EventEmitter.call(this);
@@ -17,7 +18,7 @@ function MultiCouch(args) {
ini_file: args.ini_file || prefix + "/couch.ini",
default_sys_ini: args.default_sys_ini || "/usr/local/etc/couchdb/default.ini",
pid_file: args.pid_file || prefix + "/couch.pid",
- couchdb_path: args.couchdb_path || "/usr/local/bin/couchdb",
+ couchdb_path: args.couchdb_path || which("couchdb"),
respawn: args.respawn === undefined ? 5: args.respawn
};
View
5 package.json
@@ -1,6 +1,6 @@
{
"name": "multicouch",
- "version": "0.2.6",
+ "version": "0.2.8",
"description": "Launch multiple CouchDBs from the same installation.",
"main": "lib/multicouch.js",
"scripts": {
@@ -11,6 +11,7 @@
"license": "Apache 2",
"readmeFilename": "README.md",
"dependencies": {
- "commander": "1.x"
+ "commander": "1.x",
+ "which": "1.x"
}
}

0 comments on commit 5eae3a6

Please sign in to comment.
Something went wrong with that request. Please try again.