Skip to content

Commit

Permalink
chore(autoUpdate): disable auto-update on rc/beta/alpha releases (#1100)
Browse files Browse the repository at this point in the history
* chore(autoUpdate): disable auto-update on rc/beta/alpha releases

* chore(autoUpdater): add tolowercase
  • Loading branch information
Maurice Dalderup authored Aug 15, 2019
1 parent fd72408 commit fc8225f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "https://www.github.com/nos/client",
"author": "nOS",
"homepage": "https://nos.io",
"version": "0.6.0",
"version": "0.6.0-rc.1",
"private": true,
"main": "dist/main/main.js",
"license": "MIT",
Expand Down
11 changes: 10 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import injectHeaders from './util/injectHeaders';
import installExtensions from './util/installExtensions';
import registerNosProtocol from './util/registerNosProtocol';

import pkg from '../../package.json';

// This wouldn't be necessary if we could call `electron-webpack` directly. But since we have to
// use webpack-cli (as a result of using a custom webpack config), we are faking this env var
// already being assigned.
Expand Down Expand Up @@ -95,7 +97,14 @@ function createSplashWindow() {
splashWindow.once('ready-to-show', () => {
splashWindow.show();

if (isDev) {
const pkgVersion = pkg.version.toLowerCase();

if (
isDev ||
pkgVersion.includes('rc') ||
pkgVersion.includes('beta') ||
pkgVersion.includes('alpha')
) {
createMainWindow();
} else {
autoUpdater.allowPrerelease = false;
Expand Down

0 comments on commit fc8225f

Please sign in to comment.