diff --git a/package.json b/package.json index 9335943..24e3211 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "merge-request-notifier", - "version": "1.8.2", + "version": "1.8.3", "description": "This app shows your merge requests grouped by projects and WIP status. It is accessible from the system tray.", "main": "./dist/main/main.js", "homepage": "https://github.com/codecentric/merge-request-notifier", diff --git a/src/main/autoUpdates.ts b/src/main/autoUpdates.ts index 8bf0a0d..a8b5158 100644 --- a/src/main/autoUpdates.ts +++ b/src/main/autoUpdates.ts @@ -1,4 +1,4 @@ -import { ipcMain } from 'electron' +import { ipcMain, app } from 'electron' import { autoUpdater } from 'electron-updater' import * as log from 'electron-log' import * as path from 'path' @@ -6,9 +6,12 @@ import * as path from 'path' export const setupAutoUpdater = () => { autoUpdater.autoDownload = false - if (process.env.NODE_ENV !== 'production') { + if (!app.isPackaged) { // __dirname is the "dist" folder - autoUpdater.updateConfigPath = path.join(__dirname, '../dev-app-update.yml') + const updateConfigPath = path.join(__dirname, '../dev-app-update.yml') + + log.info(`Updating the auto updater config path to "${updateConfigPath}".`) + autoUpdater.updateConfigPath = updateConfigPath } ipcMain.on('download-and-install-update', () => { diff --git a/webpack.renderer.config.js b/webpack.renderer.config.js index df37593..c215407 100644 --- a/webpack.renderer.config.js +++ b/webpack.renderer.config.js @@ -59,9 +59,6 @@ module.exports = merge.smart(baseConfig, { tsconfig: 'tsconfig-renderer.json' }), new webpack.NamedModulesPlugin(), - new HtmlWebpackPlugin(), - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') - }) + new HtmlWebpackPlugin() ] });