node-notifier
Advanced tools
Comparing version 1.0.0-beta to 1.0.0-beta2
@@ -5,5 +5,8 @@ var child_process = require('child_process') | ||
var escapeShell = function(cmd) { | ||
return cmd.replace(/(["\s'$`\\])/g,'\\$1'); | ||
}; | ||
module.exports.command = function (notifier, options, cb) { | ||
var notifyApp = exec(notifier + ' ' + options.join(' '), function (error, stdout, stderr) { | ||
var notifyApp = exec(escapeShell(notifier) + ' ' + options.join(' '), function (error, stdout, stderr) { | ||
if (error !== null) { | ||
@@ -14,3 +17,3 @@ return cb(error); | ||
cb(stderr, stdout); | ||
}); | ||
}); | ||
@@ -50,3 +53,3 @@ return notifyApp; | ||
else if (line === "(null)") { | ||
line = null; | ||
line = null; | ||
} | ||
@@ -72,3 +75,3 @@ else if (!!parseInt(line, 10)) { | ||
// Check for single line. | ||
// Check for single line. | ||
if (lines.length === 1 && lines[0].substring(0,1) === '*') { | ||
@@ -75,0 +78,0 @@ var msg = lines[0].substring(1).trim(); |
{ | ||
"name": "node-notifier", | ||
"version": "1.0.0-beta", | ||
"version": "1.0.0-beta2", | ||
"description": "A Node.js wrapper for the terminal-notifier application", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
446144
236