Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function handlePid(pid) {
if (!pid) {
notifier.notify('No pid specified');
process.exit(0);
}
if (String(pid).match(/search/i)) {
search(process.argv[3]);
} else if (Number.isNaN(Number(pid))) {
help();
} else {
// Run in BG
spawn('node', [`${__dirname}/runCheckPid.js`, pid], {
stdio: 'ignore',
detached: true,
}).unref();
}
}
msg = warning ? this.messageFormatter(warning, warning.module && warning.module.rawRequest ? warning.module.rawRequest : '') : 'Unknown';
icon = this.warningIcon;
sound = this.warningSound;
buildSuccessful = false;
} else {
title += 'Success';
if (this.suppressSuccess === "always" || (this.suppressSuccess === "initial" && !hasRun)) {
notify = false;
} else if (this.suppressSuccess === false || !buildSuccessful) {
notify = true; // previous build failed, let's show a notification even if success notifications are suppressed
}
buildSuccessful = true;
}
if (notify) {
notifier.notify(
Object.assign(this.notifyOptions, {
appName: this.appName,
title: title,
message: stripAnsi(msg),
sound: sound,
contentImage: this.logo,
icon: icon,
wait: !buildSuccessful
})
);
if (onComplete) {
onComplete(results.compilation, compilationStatus);
}
}
if (this.activateTerminalOnError && !buildSuccessful) {
function notify(options) {
log(options.title + ': ' + options.message);
if (!argv.noNotify) {
notifier.notify(options);
}
}
export function log(options: NotificationOptions) {
const title = `${options.title.toUpperCase()}`;
if (options.notify) {
notifier.notify({
title,
message: options.message,
});
}
const level = options.level || 'info';
const msg = `==> ${title} -> ${options.message}`;
switch (level) {
case 'warn': console.log(colors.red(msg)); break;
case 'error': console.log(colors.bgRed.white(msg)); break;
case 'info':
default: console.log(colors.green(msg));
}
}
const debouncedNotify = debounce(args => notifier.notify(args), 150);
const uploading = new Set();
notify: function notify(title, message) {
notifier.notify({
'title': title || 'Gulp',
'message': message || 'Please check your log or open your browser.',
icon: process.cwd() + '/icon.png'
});
}
};
function notify(msg?: string) {
if (!notifier || !msg) return
notifier.notify({
title: 'tmux-weather',
message: msg,
})
}
function notify (title, message) {
notifier.notify({
appName: 'ipfs.station',
title,
message,
icon: iconPath,
sound: true,
wait: false
})
}
this.stream.on('direct_message', message => {
self.displayDM(message.direct_message);
if (self.preferences.get('notifications')) {
notifier.notify({
title: `Message from @${message.sender_screen_name}`,
message: message.text
});
}
});