Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function doNotification(options) {
var notifier = new Notification(options);
if (!options.message) {
// Do not show an empty message
process.exit(0);
}
notifier.notify(options, function(err, msg) {
if (err) {
console.error(err.message);
process.exit(1);
}
if (msg) console.log(msg);
process.exit(0);
});
}
module.exports.onError = function (options, callback) {
var reporter;
options = options || {};
var templateOptions = options.templateOptions || {};
var callback = callback || function (err) {
err && logError({
title: "Error running notifier",
message: "Could not send message: " + err.message
}, true);
};
if (options.notifier) {
reporter = options.notifier;
} else {
if (options.host || options.appName || options.port) {
notifier = new notifier.Notification({
host: options.host || 'localhost',
appName: options.appName || 'gulp-notify',
port: options.port || '23053'
});
}
reporter = notifier.notify.bind(notifier);
}
return function (error) {
var self = this;
report(reporter, error, options, templateOptions, function () {
callback.apply(self, arguments);
self.emit && self.emit('end');
});
};
};
module.exports = function (options) {
var reporter;
var lastFile = null;
options = options || {};
var templateOptions = options.templateOptions || {};
if (options.notifier) {
reporter = options.notifier;
} else {
if (options.host || options.appName || options.port) {
notifier = new notifier.Notification({
host: options.host || 'localhost',
appName: options.appName || 'gulp-notify',
port: options.port || '23053'
});
}
reporter = notifier.notify.bind(notifier);
}
function notify (file, enc, callback) {
var stream = this;
report(reporter, file, options, templateOptions, function (err) {
logError(err, stream);
if (options.emitError) {
stream.push(file);
.alias('help', 'h')
.argv;
const config = require('./config');
const outputDirectory = 'dist';
const exePath = resolve(outputDirectory, config.get('demo:name') + '.exe');
let chain = require('./make-chain')(config, {
debug : process.argv.includes('debug'),
nominify : process.argv.includes('nominify'),
buildDirectory: 'build',
exePath,
});
const notifier = new Notification({
withFallback: true,
});
const startTime = Date.now();
let size;
chain
.then(() => {
return stat(exePath);
})
.then(stats => {
size = stats.size;
if (argv.notify) {
notifier.notify({