node-notifier
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -9,9 +9,7 @@ /** | ||
var child_process = require('child_process') | ||
, spawn = child_process.spawn | ||
, exec = child_process.exec | ||
, os = require('os') | ||
, notifier = 'vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier' | ||
, osVersionError = 'Incorrect OS. Requires Mac OS X 10.8 or higher'; | ||
, path = require('path') | ||
, notifier = path.resolve(__dirname, '../vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier') | ||
, osVersionError = 'Incorrect OS. node-notify requires Mac OS 10.8 or higher'; | ||
var isMacOSX = function (cb) { | ||
@@ -32,3 +30,3 @@ if (process.platform != 'darwin') { | ||
}); | ||
} | ||
}; | ||
@@ -47,3 +45,3 @@ var Notifier = function () { | ||
args.push('-' + key, val); | ||
}; | ||
} | ||
@@ -54,19 +52,10 @@ return args; | ||
, command = function (options, cb) { | ||
var notifyApp = spawn(notifier, options); | ||
var notifyApp = exec(notifier + ' ' + options.join(' '), function (error, stdout, stderr) { | ||
if (error !== null) { | ||
return cb(error); | ||
} | ||
notifyApp.stdout.on('data', function (data) { | ||
cb(null, data.toString()); | ||
}); | ||
cb(stderr, stdout); | ||
}); | ||
notifyApp.stderr.on('data', function (data) { | ||
cb(data.toString()); | ||
}); | ||
notifyApp.on('exit', function (code, message) { | ||
if (!code) { | ||
return cb(message); | ||
} | ||
cb(null, message); | ||
}); | ||
return notifyApp; | ||
@@ -77,2 +66,3 @@ }; | ||
var argsList = constructArgumentList(options); | ||
callback = callback || function () {}; | ||
@@ -79,0 +69,0 @@ if(this.isOSX) { |
{ | ||
"name": "node-notifier", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"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
439623
55
77