GitbookIO / nuts

:chestnut: Releases/downloads server with auto-updater and GitHub as a backend
http://nuts.gitbook.com
Apache License 2.0
1.25k stars 299 forks source link

Fail to detect osx_64 platform when "32" is part of version number #121

Open alexstrat opened 7 years ago

alexstrat commented 7 years ago

By default, for OSX, electron-builder generates files with names {app_name}-{version}-mac.zip and {app_name}-{version}.dmg.

As soon as the filename includes 32, for instance in version part, and does not explicitly mention x64, the platform is incorrectly detected as osx_32:

var platforms = require('./lib/utils/platforms');

platforms.detect('myapp-0.31.1-mac.zip') // 'osx_64' ok
platforms.detect('myapp-0.32.1-mac.zip') // 'osx_32' not ok

platforms.detect('myapp-0.31.1.dmg') // 'osx_64' ok
platforms.detect('myapp-0.32.1.dmg') // 'osx_32' not ok

// for info:
platforms.detect('myapp-0.32.1-darwin-x64.zip') // 'osx_64' ok
alexstrat commented 7 years ago

Same for Windows:

var platforms = require('./lib/utils/platforms');

platforms.detect('Station.Setup.0.1.64.exe') // 'windows_64' not ok
platforms.detect('Station.Setup.0.1.63.exe') // 'windows_32' ok