Skip to content

Commit

Permalink
Merge pull request #171 from pascaliske/master
Browse files Browse the repository at this point in the history
Use a more specific condition for debug output.
  • Loading branch information
mikaelbr committed May 16, 2017
2 parents 06995ea + a14a82f commit 95e54ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTE.md
Expand Up @@ -7,7 +7,7 @@ node-notifier love getting pull requests and other help. Here's a quick guide.
If you want to see what command is run, execute the node program with environment variable `DEBUG=true`, e.g.:

```
DEBUG=true node index.js
DEBUG="notifier" node index.js
```

```
Expand Down
8 changes: 4 additions & 4 deletions lib/utils.js
Expand Up @@ -42,7 +42,7 @@ var notifySendFlags = {

module.exports.command = function(notifier, options, cb) {
notifier = shellwords.escape(notifier);
if (process.env.DEBUG) {
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(' '));
Expand All @@ -58,7 +58,7 @@ module.exports.command = function(notifier, options, cb) {
};

module.exports.fileCommand = function(notifier, options, cb) {
if (process.env.DEBUG) {
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
console.info('node-notifier debug info (fileCommand):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
Expand All @@ -71,7 +71,7 @@ module.exports.fileCommand = function(notifier, options, cb) {
};

module.exports.fileCommandJson = function(notifier, options, cb) {
if (process.env.DEBUG) {
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
console.info('node-notifier debug info (fileCommandJson):');
console.info('[notifier path]', notifier);
console.info('[notifier options]', options.join(' '));
Expand All @@ -90,7 +90,7 @@ module.exports.fileCommandJson = function(notifier, options, cb) {
};

module.exports.immediateFileCommand = function(notifier, options, cb) {
if (process.env.DEBUG) {
if (process.env.DEBUG && process.env.DEBUG.indexOf('notifier') !== -1) {
console.info('node-notifier debug info (notifier):');
console.info('[notifier path]', notifier);
}
Expand Down

0 comments on commit 95e54ac

Please sign in to comment.