Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
fix: skip all auto-updating code when running in a snap
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Feb 18, 2021
1 parent dea9033 commit 809efcb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions app/javascripts/main/updateManager.ts
Expand Up @@ -12,6 +12,8 @@ import { updates as str } from './strings';
import { handle } from './testing';
import { isTesting } from './utils';

declare const AUTO_UPDATING_AVAILABLE: boolean;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function logError(...message: any) {
console.error('updateManager:', ...message);
Expand Down Expand Up @@ -88,6 +90,9 @@ export function setupUpdates(
appState: AppState,
backupsManager: BackupsManager
): void {
if (!AUTO_UPDATING_AVAILABLE) {
return;
}
if (updatesSetup) {
throw Error('Already set up updates.');
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -89,8 +89,7 @@
"StartupWMClass": "standard notes"
},
"target": [
"AppImage",
"snap"
"AppImage"
]
},
"snap": {
Expand All @@ -101,8 +100,9 @@
}
},
"scripts": {
"build:all": "yarn lint && yarn build:web && yarn clean:build && electron-builder -mwl --x64 --ia32 && yarn build:write-sums",
"build": "yarn lint && yarn build:web && node scripts/build.mjs",
"build:all": "yarn lint && yarn build:web && yarn clean:build && electron-builder -mwl --x64 --ia32 && && yarn build:snap && yarn build:write-sums",
"build:snap": "node scripts/build.mjs snap",
"build:write-sums": "node scripts/sums.mjs",
"build:remove-unpacked": "rimraf dist/{linux-*,mac,win-*}",
"build:web": "git submodule update && cd web && rimraf node_modules && yarn && yarn run bundle:desktop",
Expand Down
13 changes: 7 additions & 6 deletions webpack.prod.js
@@ -1,9 +1,10 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');

module.exports = common().map((config) =>
merge(config, {
mode: 'production',
devtool: 'source-map',
})
);
module.exports = (env) =>
common(env).map((config) =>
merge(config, {
mode: 'production',
devtool: 'source-map',
})
);

0 comments on commit 809efcb

Please sign in to comment.