Skip to content

Commit be2d4c1

Browse files
authored
feat: exit early on linux (#29)
* feat: exit early on linux * fix process check
1 parent b1aa517 commit be2d4c1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const userAgent = format(
1515
os.platform(),
1616
os.arch()
1717
)
18+
const supportedPlatforms = ['darwin', 'win32']
1819

1920
module.exports = function updater (opts = {}) {
2021
// check for bad input early, so it will be logged during development
@@ -42,6 +43,12 @@ function initUpdater (opts) {
4243
logger.log(...args)
4344
}
4445

46+
// exit early on unsupported platforms, e.g. `linux`
47+
if (typeof process !== 'undefined' && process.platform && !supportedPlatforms.includes(process.platform)) {
48+
log(`Electron's autoUpdater does not support the '${process.platform}' platform`)
49+
return
50+
}
51+
4552
log('feedURL', feedURL)
4653
log('requestHeaders', requestHeaders)
4754
autoUpdater.setFeedURL(feedURL, requestHeaders)

0 commit comments

Comments
 (0)