Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 664d665

Browse files
committed
Conditional python error log
1 parent d68eb08 commit 664d665

File tree

1 file changed

+32
-22
lines changed

1 file changed

+32
-22
lines changed

main.js

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ app.on('ready', function() {
528528
var osTrayIcon = 'openbazaar-mac-system-tray.png';
529529

530530
trayMenu = new tray(__dirname + '/imgs/' + osTrayIcon);
531-
var contextMenu = menu.buildFromTemplate([
531+
var template = [
532532
{
533533
label: 'Start Local Server', type: 'normal', click: function () {
534534
start_local_server();
@@ -554,7 +554,7 @@ app.on('ready', function() {
554554
dialog.showErrorBox('Unable To Open Debug Log',
555555
'There was an error and we are unable to open the server debug log at this time.\n\n' + err);
556556
}
557-
557+
558558
require('open')(debugPath);
559559
});
560560
}},
@@ -570,31 +570,41 @@ app.on('ready', function() {
570570

571571
require('open')('mailto:[email protected]?subject=OpenBazaar Debug Report&body=' + body);
572572

573-
}},
574-
{label: 'View Python Error Log', type: 'normal', click: function() {
573+
}}
574+
];
575+
576+
if(launched_from_installer) {
577+
template.push({label: 'View Python Error Log', type: 'normal', click: function() {
575578
var logPath = __dirname + path.sep + 'python_error.log';
576579
require('open')(logPath);
577-
}},
578-
{label: 'Send Debug Package', type: 'normal', click: function() {
579-
var body = 'OpenBazaar Debug Report\n\n';
580-
body += 'OS: ' + os.platform() + ' ' + os.release() + '\n';
581-
body += 'Architecture: ' + os.arch() + '\n';
582-
body += 'CPUs: ' + JSON.stringify(os.cpus(), null, 2) + '\n';
583-
body += 'Free Memory: ' + os.freemem() + '\n';
584-
body += 'Total Memory: ' + os.totalmem() + '\n\n';
585-
body += 'Debug Log:\n';
586-
body += serverOut;
587-
588-
require('open')('mailto:[email protected]?subject=OpenBazaar Debug Report&body=' + body);
580+
}});
581+
}
589582

590-
}},
591-
{type: 'separator'},
583+
template.push(
592584
{
593-
label: 'Quit', type: 'normal', accelerator: 'Command+Q', click: function () {
594-
app.quit();
595-
}
585+
label: 'Send Debug Package', type: 'normal', click: function() {
586+
var body = 'OpenBazaar Debug Report\n\n';
587+
body += 'OS: ' + os.platform() + ' ' + os.release() + '\n';
588+
body += 'Architecture: ' + os.arch() + '\n';
589+
body += 'CPUs: ' + JSON.stringify(os.cpus(), null, 2) + '\n';
590+
body += 'Free Memory: ' + os.freemem() + '\n';
591+
body += 'Total Memory: ' + os.totalmem() + '\n\n';
592+
body += 'Debug Log:\n';
593+
body += serverOut;
594+
595+
require('open')('mailto:[email protected]?subject=OpenBazaar Debug Report&body=' + body);
596+
}
597+
},
598+
{
599+
type: 'separator' },
600+
{
601+
label: 'Quit', type: 'normal', accelerator: 'Command+Q', click: function () {
602+
app.quit();
603+
}
596604
}
597-
]);
605+
);
606+
607+
var contextMenu = menu.buildFromTemplate(template);
598608

599609
trayMenu.setContextMenu(contextMenu);
600610

0 commit comments

Comments
 (0)