Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@ var unilateralTags = ['subscription', 'log'];
* * 'watchmanBinaryPath' (string) Absolute path to the watchman binary.
* If not provided, the Client locates the binary using the PATH specified
* by the node child_process's default env.
* * 'args' (string[]) Additional arguments to be passed to the call to the
* binary when watchman is executed. `watchman -h` for a detailed list.
*/
function Client(options) {
var self = this;
EE.call(this);

this.watchmanBinaryPath = 'watchman';
this.args = [];

if (options && options.watchmanBinaryPath) {
this.watchmanBinaryPath = options.watchmanBinaryPath.trim();
};
if (options && options.args) {
this.args = options.args;
};
this.commands = [];
}
util.inherits(Client, EE);
Expand Down Expand Up @@ -142,7 +149,7 @@ Client.prototype.connect = function() {
// We need to ask the client binary where to find it.
// This will cause the service to start for us if it isn't
// already running.
var args = ['--no-pretty', 'get-sockname'];
var args = [...this.args, '--no-pretty', 'get-sockname'];

// We use the more elaborate spawn rather than exec because there
// are some error cases on Windows where process spawning can hang.
Expand Down