--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
35
node_modules/gulp-notify/lib/withReporter.js
generated
vendored
Normal file
35
node_modules/gulp-notify/lib/withReporter.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
var gutil = require("gulp-util");
|
||||
var api = require("./extra_api");
|
||||
var notify = require("./notify");
|
||||
|
||||
module.exports = function (reporter) {
|
||||
if (!reporter) throw new gutil.PluginError("gulp-notify", "No custom reporter defined.");
|
||||
|
||||
var inner = function (options) {
|
||||
options = setOptions(options, reporter);
|
||||
return notify(options);
|
||||
};
|
||||
|
||||
inner.onError = function (options) {
|
||||
options = setOptions(options, reporter);
|
||||
return api.onError(options);
|
||||
};
|
||||
|
||||
inner.logLevel = api.logLevel;
|
||||
inner.logger = api.logger;
|
||||
|
||||
return inner;
|
||||
};
|
||||
|
||||
function setOptions (options, reporter) {
|
||||
options = options || {};
|
||||
|
||||
if (typeof options !== "object") {
|
||||
options = {
|
||||
message: options
|
||||
};
|
||||
}
|
||||
|
||||
options.notifier = reporter;
|
||||
return options;
|
||||
}
|
||||
Loading…
Reference in a new issue