diff --git a/app/assets/js/assetguard.js b/app/assets/js/assetguard.js index 6c6c8e73..dae336ac 100644 --- a/app/assets/js/assetguard.js +++ b/app/assets/js/assetguard.js @@ -21,7 +21,6 @@ const child_process = require('child_process') const crypto = require('crypto') const EventEmitter = require('events') const fs = require('fs') -const isDev = require('electron-is-dev') const mkpath = require('mkdirp') const path = require('path') const Registry = require('winreg') @@ -31,6 +30,7 @@ const zlib = require('zlib') const ConfigManager = require('./configmanager') const DistroManager = require('./distromanager') +const isDev = require('./isdev') // Constants const PLATFORM_MAP = { diff --git a/app/assets/js/isdev.js b/app/assets/js/isdev.js new file mode 100644 index 00000000..1ed55e5b --- /dev/null +++ b/app/assets/js/isdev.js @@ -0,0 +1,5 @@ +'use strict' +const getFromEnv = parseInt(process.env.ELECTRON_IS_DEV, 10) === 1 +const isEnvSet = 'ELECTRON_IS_DEV' in process.env + +module.exports = isEnvSet ? getFromEnv : (process.defaultApp || /node_modules[\\/]electron[\\/]/.test(process.execPath)) \ No newline at end of file diff --git a/app/assets/js/scripts/uicore.js b/app/assets/js/scripts/uicore.js index 9cc3ee15..50a1753a 100644 --- a/app/assets/js/scripts/uicore.js +++ b/app/assets/js/scripts/uicore.js @@ -7,7 +7,7 @@ // Requirements const $ = require('jquery') const {ipcRenderer, remote, shell, webFrame} = require('electron') -const isDev = require('electron-is-dev') +const isDev = require('./assets/js/isdev') const LoggerUtil = require('./assets/js/loggerutil') const loggerUICore = LoggerUtil('%c[UICore]', 'color: #000668; font-weight: bold') diff --git a/index.js b/index.js index c144b1b4..8bfd03ab 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const {app, BrowserWindow, ipcMain} = require('electron') const autoUpdater = require('electron-updater').autoUpdater const ejse = require('ejs-electron') const fs = require('fs') -const isDev = require('electron-is-dev') +const isDev = require('./app/assets/js/isdev') const path = require('path') const semver = require('semver') const url = require('url') diff --git a/package-lock.json b/package-lock.json index fe157210..3401cbd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -993,11 +993,6 @@ } } }, - "electron-is-dev": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-0.3.0.tgz", - "integrity": "sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4=" - }, "electron-osx-sign": { "version": "0.4.10", "resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz", diff --git a/package.json b/package.json index 98d4e3eb..23a20403 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "discord-rpc": "^3.0.0", "ejs": "^2.6.1", "ejs-electron": "^2.0.3", - "electron-is-dev": "=0.3.0", "electron-updater": "^3.1.2", "github-syntax-dark": "^0.5.0", "jquery": "^3.3.1",