node-notifier
Advanced tools
Comparing version 3.0.2 to 3.0.3
var cp = require('child_process') | ||
, os = require('os') | ||
, osVersionError = 'Incorrect OS. node-notify requires Mac OS 10.8 or higher' | ||
, shellwords = require('shellwords'); | ||
, shellwords = require('shellwords') | ||
; | ||
@@ -14,3 +16,3 @@ var escapeQuotes = function (str) { | ||
module.exports.command = function (notifier, options, cb) { | ||
var notifyApp = exec(shellwords.escape(notifier) + ' ' + options.join(' '), function (error, stdout, stderr) { | ||
var notifyApp = cp.exec(shellwords.escape(notifier) + ' ' + options.join(' '), function (error, stdout, stderr) { | ||
if (error) { | ||
@@ -56,4 +58,4 @@ return cb(error); | ||
module.exports.isMacOSX = function (cb) { | ||
if (process.platform != 'darwin') { | ||
return cb(true, osVersionError); | ||
if (os.type().toLowerCase() != 'darwin') { | ||
return cb(true, "You can't use the terminal-notifier reporter unless you are on a Mac."); | ||
} | ||
@@ -60,0 +62,0 @@ return module.exports.getOSXVersion(function (error, stdout, stderr) { |
{ | ||
"name": "node-notifier", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "A Node.js module for sending notifications on mac, windows and linux", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -179,10 +179,6 @@ # node-notifier [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
## Module TODO | ||
1. Add tests for growl | ||
## Changelog | ||
### `v3.0.1` | ||
### `v3.0.2` | ||
1. Fixes version check for Mac OS X Yosemite | ||
@@ -194,2 +190,5 @@ | ||
[![NPM downloads][npm-downloads]][npm-url] | ||
## License | ||
@@ -200,8 +199,9 @@ | ||
[npm-url]: https://npmjs.org/package/node-notifier | ||
[npm-image]: https://badge.fury.io/js/node-notifier.png | ||
[npm-image]: http://img.shields.io/npm/v/node-notifier.svg?style=flat | ||
[npm-downloads]: http://img.shields.io/npm/dm/node-notifier.svg?style=flat | ||
[travis-url]: http://travis-ci.org/mikaelbr/node-notifier | ||
[travis-image]: https://secure.travis-ci.org/mikaelbr/node-notifier.png?branch=master | ||
[travis-image]: http://img.shields.io/travis/mikaelbr/node-notifier.svg?style=flat | ||
[depstat-url]: https://david-dm.org/mikaelbr/node-notifier | ||
[depstat-image]: https://david-dm.org/mikaelbr/node-notifier.png | ||
[depstat-url]: https://gemnasium.com/mikaelbr/node-notifier | ||
[depstat-image]: http://img.shields.io/gemnasium/mikaelbr/node-notifier.svg?style=flat |
@@ -19,3 +19,3 @@ var NotificationCenter = require('../').NotificationCenter | ||
os.type = function () { | ||
return "Linux"; | ||
return "Darwin"; | ||
}; | ||
@@ -22,0 +22,0 @@ |
var should = require('should') | ||
, cp = require('child_process') | ||
, assert = require('assert'); | ||
, assert = require('assert') | ||
, os = require('os') | ||
; | ||
var _ = require('../lib/utils'); | ||
var originalPlatform = process.platform; | ||
var originalType = os.type; | ||
var originalVersion = _.getOSXVersion; | ||
@@ -13,7 +14,9 @@ | ||
before(function () { | ||
process.platform = "darwin"; | ||
os.type = function () { | ||
return "Darwin"; | ||
}; | ||
}); | ||
after(function () { | ||
process.platform = originalPlatform; | ||
os.type = originalType; | ||
_.getOSXVersion = originalVersion; | ||
@@ -24,8 +27,8 @@ }); | ||
_.getOSXVersion = function (cb) { | ||
cb(null, "10.8", ""); | ||
cb(null, "10.8"); | ||
}; | ||
_.isMacOSX(function (error, msg) { | ||
error.should.be.false; | ||
(msg === void 0).should.be.true; | ||
done(); | ||
@@ -37,3 +40,3 @@ }); | ||
_.getOSXVersion = function (cb) { | ||
cb(null, "10.7", ""); | ||
cb(null, "10.7"); | ||
}; | ||
@@ -43,2 +46,3 @@ | ||
error.should.be.true; | ||
(msg === void 0).should.be.false; | ||
done(); | ||
@@ -50,3 +54,3 @@ }); | ||
_.getOSXVersion = function (cb) { | ||
cb(null, "10.10", ""); | ||
cb(null, "10.10"); | ||
}; | ||
@@ -56,2 +60,3 @@ | ||
error.should.be.false; | ||
(msg === void 0).should.be.true; | ||
done(); | ||
@@ -63,3 +68,3 @@ }); | ||
_.getOSXVersion = function (cb) { | ||
cb(null, "10.10\n", ""); | ||
cb(null, "10.10\n"); | ||
}; | ||
@@ -69,2 +74,3 @@ | ||
error.should.be.false; | ||
(msg === void 0).should.be.true; | ||
done(); | ||
@@ -71,0 +77,0 @@ }); |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
493342
561
205
1
1