Skip to content

Commit

Permalink
fix(auto-updates): no updates in platforms that don't support it
Browse files Browse the repository at this point in the history
  • Loading branch information
sr258 committed Apr 18, 2021
1 parent 8637a0f commit e6b33fb
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion server/src/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ import IServerConfig from './IServerConfig';
let updateAvailable: boolean = false;
let updating: boolean = false;

export const platformSupportsUpdates = () => {
if (process.platform === 'win32') {
return !process.windowsStore;
}
if (process.platform === 'darwin') {
return !process.mas;
}
if (process.platform === 'linux') {
if (process.env.APPIMAGE) {
return true;
}
}
return false;
};

export default async function boot(
app: Electron.App,
websocket: SocketIO.Server,
Expand Down Expand Up @@ -46,7 +61,10 @@ export default async function boot(
}
});

if ((await fsExtra.readJSON(serverConfig.settingsFile)).autoUpdates) {
if (
platformSupportsUpdates() &&
(await fsExtra.readJSON(serverConfig.settingsFile)).autoUpdates
) {
autoUpdater.checkForUpdates();
}
}

0 comments on commit e6b33fb

Please sign in to comment.