Skip to content

Commit

Permalink
fix: snyk test with vulns is not a bad command
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Apr 15, 2016
1 parent e1f75e7 commit 0b79c74
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ var cli = args.method.apply(null, args.options._).then(function (result) {
var spinner = require('../lib/spinner');
spinner.clearAll();
var analytics = require('../lib/analytics');
analytics.add('error-message', error.message);
analytics.add('error', error.stack);
analytics.add('error-code', error.code);
analytics.add('command', args.command);
var command = 'bad-command';

if (error.code === 'VULNS') {
// this isn't a bad command, so we won't record it as such
command = args.command;
} else {
analytics.add('error-message', error.message);
analytics.add('error', error.stack);
analytics.add('error-code', error.code);
analytics.add('command', args.command);
}

var res = analytics({
command: 'bad-command',
command: command,
args: args.options._,
});

Expand Down

0 comments on commit 0b79c74

Please sign in to comment.