gulp-notify
Advanced tools
Comparing version 1.1.0 to 1.1.1
var through = require("through2"); | ||
var gutil = require("gulp-util"); | ||
var notifier = require("node-notifier"); | ||
var Notification = require("node-notifier"); | ||
var report = require("./report"); | ||
@@ -16,4 +16,11 @@ | ||
module.exports.onError = function (options) { | ||
var reporter; | ||
options = options || {}; | ||
var reporter = options.notifier || notifier.notify; | ||
if (options.notifier) { | ||
reporter = options.notifier; | ||
} else { | ||
var notifier = new Notification(options); | ||
reporter = notifier.notify.bind(notifier); | ||
} | ||
return function (error) { | ||
@@ -20,0 +27,0 @@ report(reporter, error, options); |
@@ -17,3 +17,3 @@ var through = require("through2"); | ||
var notifier = new Notification(options); | ||
var reporter = notifier.notify.bind(notifier); | ||
reporter = notifier.notify.bind(notifier); | ||
} | ||
@@ -20,0 +20,0 @@ var lastFile = null; |
{ | ||
"name": "gulp-notify", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A plugin for Gulp to send messages to Mac Notification Center or Linux' notify-send", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -8,7 +8,8 @@ # gulp-notify [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
| ------------- |--------------| | ||
| Description | Send messages to Mac Notification Center or Linux notifications (using `notify-send`) using the [node-notifier](https://github.com/mikaelbr/node-notifier) module. Can also [specify custom notifier](#notifywithreporterfunction) (e.g. Growl notification). | | ||
| Description | Send messages to Mac Notification Center or Linux notifications (using `notify-send`) using the [node-notifier](https://github.com/mikaelbr/node-notifier) module or Growl if not any of them. Can also [specify custom notifier](#notifywithreporterfunction). | | ||
| Node Version | >= 0.8 | | ||
| Package Version | 1.0.0-beta | | ||
| Package Version | 1.1.0 | | ||
**Note: Without overriding the notifier, Mac OS X >= 10.8 or as of v0.3.2, Linux with `notify-send` installed is required for this to run.** | ||
**After version `1.1.0` this now supports Growl natively.** | ||
@@ -67,3 +68,3 @@ ## Usage | ||
The returned string can be a lodash template as | ||
The returned string can be a lodash template as | ||
it is passed through [gulp-util.template](https://github.com/gulpjs/gulp-util#templatestring-data). | ||
@@ -73,2 +74,6 @@ | ||
*Options are passed onto the reporter, so on Windows, you can define | ||
Growl host and so on. See [node-notifier](https://github.com/mikaelbr/node-notifier) | ||
for more information* | ||
#### options.onLast | ||
@@ -78,3 +83,3 @@ Type: `Boolean` | ||
If the notification should only happen on the last file | ||
If the notification should only happen on the last file | ||
of the stream. Per default a notification is triggered | ||
@@ -134,3 +139,3 @@ on each file. | ||
Swap out the notifier by passing in an function. | ||
Swap out the notifier by passing in an function. | ||
The function expects two arguments: options and callback. | ||
@@ -227,3 +232,3 @@ | ||
Set if logger should be used or not. If log level is set to 0, | ||
no logging will be used. If no new log level is passed, the | ||
no logging will be used. If no new log level is passed, the | ||
current log level is returned. | ||
@@ -279,2 +284,5 @@ | ||
### `v1.1.0` | ||
1. Bumps dependency for `node-notifier`. Now supports Growl on Windows! | ||
### `v1.0.0-beta` | ||
@@ -281,0 +289,0 @@ 1. Major rewrites and restructure in code |
37725
811
310