Skip to content

Commit

Permalink
feat: exit early on linux (#29)
Browse files Browse the repository at this point in the history
* feat: exit early on linux

* fix process check
  • Loading branch information
zeke authored Jun 11, 2018
1 parent b1aa517 commit be2d4c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit be2d4c1

Please sign in to comment.