From 116b164da29ca6e3928055f0e42dbd30bf104cd4 Mon Sep 17 00:00:00 2001 From: ziajka Date: Tue, 3 Apr 2018 15:58:21 +0200 Subject: [PATCH] Check if we are on develop version and don't send reports --- main.js | 13 +++++++++++-- sentry.js | 13 ++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/main.js b/main.js index 931a9895..edcacb40 100644 --- a/main.js +++ b/main.js @@ -18,7 +18,14 @@ let serverProc = null; let isWin = /^win/.test(process.platform); + const createServerProc = () => { + const directory = path.join(__dirname, 'dist'); + + if (!fs.existsSync(directory)) { + return; + } + fs.readdir(path.join(__dirname, 'dist'), (err, files) => { var serverPath = null; @@ -45,8 +52,10 @@ const createServerProc = () => { } const exitServerProc = () => { - serverProc.kill(); - serverProc = null; + if(serverProc) { + serverProc.kill(); + serverProc = null; + } } diff --git a/sentry.js b/sentry.js index 9c991896..4ad46661 100644 --- a/sentry.js +++ b/sentry.js @@ -1,8 +1,15 @@ const { SentryClient } = require('@sentry/electron'); +var fs = require('fs'); const DSN = 'https://cb7b474b2e874afb8e400c47d1452ecc:7876224cbff543d992cb0ac4021962f8@sentry.io/1040940'; -SentryClient.create({ - dsn: DSN -}); +const isDev = () => { + return fs.existsSync('.git'); +}; + +if (!isDev()) { + SentryClient.create({ + dsn: DSN + }); +}