From be2d4c1f451243624e92b855c8aaf6ff12d50552 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Mon, 11 Jun 2018 21:03:10 +0200 Subject: [PATCH] feat: exit early on linux (#29) * feat: exit early on linux * fix process check --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index 9ee2eb9..6c0bd13 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,7 @@ const userAgent = format( os.platform(), os.arch() ) +const supportedPlatforms = ['darwin', 'win32'] module.exports = function updater (opts = {}) { // check for bad input early, so it will be logged during development @@ -42,6 +43,12 @@ function initUpdater (opts) { logger.log(...args) } + // exit early on unsupported platforms, e.g. `linux` + if (typeof process !== 'undefined' && process.platform && !supportedPlatforms.includes(process.platform)) { + log(`Electron's autoUpdater does not support the '${process.platform}' platform`) + return + } + log('feedURL', feedURL) log('requestHeaders', requestHeaders) autoUpdater.setFeedURL(feedURL, requestHeaders)