Skip to content
Permalink
Browse files Browse the repository at this point in the history
Merge pull request #4 from nealpoole/exec-fix
Replacing call to exec with execFile.
  • Loading branch information
mytrile committed May 14, 2013
2 parents 688e135 + 8e2e730 commit dfe7801
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/libnotify.js
Expand Up @@ -55,18 +55,17 @@ exports.binVersion = function(callback) {

exports.notify = function(msg, options, callback) {
var image,
args = ['notify-send','"' + msg + '"'],
args = [msg],
options = options || {}
this.binVersion(function(err, version){
if (err) return callback(err)
if (image = options.image) args.push('-i ' + image)
if (image = options.image) args.push('-i', image)
if (options.time) args.push('-t', options.time)
if (options.category) args.push('-c', options.category)
if (options.urgency) args.push('-u', options.urgency)
if (options.title) {
args.shift()
args.unshift('notify-send', '"'+ options.title +'"')
args.unshift(options.title)
}
child_process.exec(args.join(' '), callback)
child_process.execFile('notify-send', args, {}, callback)
})
}

0 comments on commit dfe7801

Please sign in to comment.