Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions lib/gpg.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ var GPG = {
spawnGPG(stdin, args, fn);
},

/**
* Specify the path to gpg
*/
setPath: function(path) {
spawnGPG.setGpgPath(path)
},

/**
* Raw streaming call to gpg. Reads from input file and writes to output file.
*
Expand Down
7 changes: 6 additions & 1 deletion lib/spawnGPG.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,14 @@ module.exports.streaming = function(options, args, cb) {
gpg.stdout.pipe(destStream);
};

var gpgPath = 'gpg';
module.exports.setGpgPath = function(p) {
gpgPath = p;
};

// Wrapper around spawn. Catches error events and passed global args.
function spawnIt(args, fn) {
var gpg = spawn('gpg', globalArgs.concat(args || []) );
var gpg = spawn(gpgPath, globalArgs.concat(args || []) );
gpg.on('error', fn);
return gpg;
}
Expand Down