Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a more specific condition for debug output. #171

Merged
merged 3 commits into from
May 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTE.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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