mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 14:37:47 +00:00
Include the username used in Sentry errors, to help us debug them
This commit is contained in:
parent
3a44782c38
commit
a5b535753f
@ -1,10 +1,12 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
var Mixpanel, Promise, _, packageJSON, resin;
|
||||
var Mixpanel, Promise, Raven, _, packageJSON, resin;
|
||||
|
||||
_ = require('lodash');
|
||||
|
||||
Mixpanel = require('mixpanel');
|
||||
|
||||
Raven = require('raven');
|
||||
|
||||
Promise = require('bluebird');
|
||||
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
@ -22,15 +24,23 @@ exports.trackCommand = function(capitanoCommand) {
|
||||
resinUrl: resin.settings.get('resinUrl'),
|
||||
username: resin.auth.whoami(),
|
||||
mixpanel: exports.getLoggerInstance()
|
||||
}).then(function(data) {
|
||||
}).then(function(arg) {
|
||||
var mixpanel, resinUrl, username;
|
||||
username = arg.username, resinUrl = arg.resinUrl, mixpanel = arg.mixpanel;
|
||||
return capitanoStateGetMatchCommandAsync(capitanoCommand.command).then(function(command) {
|
||||
return data.mixpanel.track("[CLI] " + (command.signature.toString()), {
|
||||
distinct_id: data.username,
|
||||
Raven.mergeContext({
|
||||
user: {
|
||||
id: username,
|
||||
username: username
|
||||
}
|
||||
});
|
||||
return mixpanel.track("[CLI] " + (command.signature.toString()), {
|
||||
distinct_id: username,
|
||||
argv: process.argv.join(' '),
|
||||
version: packageJSON.version,
|
||||
node: process.version,
|
||||
arch: process.arch,
|
||||
resinUrl: data.resinUrl,
|
||||
resinUrl: resinUrl,
|
||||
platform: process.platform,
|
||||
command: capitanoCommand
|
||||
});
|
||||
|
@ -1,5 +1,6 @@
|
||||
_ = require('lodash')
|
||||
Mixpanel = require('mixpanel')
|
||||
Raven = require('raven')
|
||||
Promise = require('bluebird')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
packageJSON = require('../package.json')
|
||||
@ -14,14 +15,18 @@ exports.trackCommand = (capitanoCommand) ->
|
||||
resinUrl: resin.settings.get('resinUrl')
|
||||
username: resin.auth.whoami()
|
||||
mixpanel: exports.getLoggerInstance()
|
||||
.then (data) ->
|
||||
.then ({ username, resinUrl, mixpanel }) ->
|
||||
return capitanoStateGetMatchCommandAsync(capitanoCommand.command).then (command) ->
|
||||
data.mixpanel.track "[CLI] #{command.signature.toString()}",
|
||||
distinct_id: data.username
|
||||
Raven.mergeContext(user: {
|
||||
id: username,
|
||||
username
|
||||
})
|
||||
mixpanel.track "[CLI] #{command.signature.toString()}",
|
||||
distinct_id: username
|
||||
argv: process.argv.join(' ')
|
||||
version: packageJSON.version
|
||||
node: process.version
|
||||
arch: process.arch
|
||||
resinUrl: data.resinUrl
|
||||
resinUrl: resinUrl
|
||||
platform: process.platform
|
||||
command: capitanoCommand
|
||||
|
Loading…
Reference in New Issue
Block a user