Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports.command = function(notifier, options, cb) {
notifier = shellwords.escape(notifier);
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
console.info('node-notifier debug info (command):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
}
return cp.exec(notifier + ' ' + options.join(' '), function(
error,
stdout,
stderr
) {
if (error) return cb(error);
cb(stderr, stdout);
});
};
module.exports.command = function(notifier, options, cb) {
notifier = shellwords.escape(notifier);
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
console.info('node-notifier debug info (command):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
}
return cp.exec(notifier + ' ' + options.join(' '), function(
error,
stdout,
stderr
) {
if (error) return cb(error);
cb(stderr, stdout);
});
};
module.exports.command = function(notifier, options, cb) {
notifier = shellwords.escape(notifier);
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
console.info('node-notifier debug info (command):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
}
return cp.exec(notifier + ' ' + options.join(' '), function(
error,
stdout,
stderr
) {
if (error) return cb(error);
cb(stderr, stdout);
});
};
module.exports.command = function(notifier, options, cb) {
notifier = shellwords.escape(notifier);
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
console.info('node-notifier debug info (command):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
}
return cp.exec(notifier + ' ' + options.join(' '), function(
error,
stdout,
stderr
) {
if (error) return cb(error);
cb(stderr, stdout);
});
};
var zopfli = function(filePath, destPath, options, callback) {
var args = [
'-c',
'--i' + options.iterations,
options.format == 'gzip' ? '--gzip'
: options.format == 'deflate' ? '--deflate'
: '--zlib',
shellEscape(filePath)
];
var bin = options.path || 'zopfli';
if (options.splitLast) {
args.unshift('--splitlast');
};
var command = bin + ' ' + args.join(' ') + ' > ' + shellEscape(destPath);
exec(command, function(error, stdout, stderr) {
callback.call(this, error || stderr, stdout);
});
};
var args = [
'-c',
'--i' + options.iterations,
options.format == 'gzip' ? '--gzip'
: options.format == 'deflate' ? '--deflate'
: '--zlib',
shellEscape(filePath)
];
var bin = options.path || 'zopfli';
if (options.splitLast) {
args.unshift('--splitlast');
};
var command = bin + ' ' + args.join(' ') + ' > ' + shellEscape(destPath);
exec(command, function(error, stdout, stderr) {
callback.call(this, error || stderr, stdout);
});
};