karaggeorge / electron-builder-notarize

Notarize Electron applications using electron-builder
MIT License
80 stars 20 forks source link

Fix wrong check for target platform #1

Closed beevelop closed 4 years ago

beevelop commented 4 years ago

As of right now, this module is not compatible with Linux and Windows. This is caused by a small mistake in the platform check. You should check for params.electronPlatformName instead of process.platform.

Tested it for macOS, Linux and Windows; especially when building a "combined" builds (e.g. -mwl).

The following exception will be thrown with the current version:

Notarizing com.[...] found at /[...]/Foobar.app
  ⨯ Failed to zip application, exited with code: 12

    zip warning: name not matched: Foobar.app

zip error: Nothing to do! (try: zip -r -y /var/folders/l7/t8_bx7q56514y3jvn1w_5sjc0000gn/T/electron-notarize-BOOg8u/Foobar.zip . -i Foobar.app)
  stackTrace=
Error: Failed to zip application, exited with code: 12
zip warning: name not matched: Foobar.app
zip error: Nothing to do! (try: zip -r -y /var/folders/l7/t8_bx7q56514y3jvn1w_5sjc0000gn/T/electron-notarize-BOOg8u/Foobar.zip . -i Foobar.app)

This is the output of electron-builder v21.2.0:

{
  appOutDir: '/Users/[...]/dist/mac',
  outDir: '/Users/[...]/dist',
  arch: 1,
  targets: [
    DmgTarget {
      name: 'dmg',
      [...]
    },
    ArchiveTarget {
      name: 'zip',
      [...]
    }
  ],
  packager: MacPackager {
    platform: Platform {
      name: 'mac',
      buildConfigurationKey: 'mac',
      nodeName: 'darwin'
    },
  },
  electronPlatformName: 'darwin'
}
karaggeorge commented 4 years ago

Thank you @beevelop. Released as electron-builder-notarize@1.0.7

beevelop commented 4 years ago

Awesome, thank you!