electron-osx-sign.js 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env node
  2. var fs = require('fs')
  3. var path = require('path')
  4. var args = require('minimist')(process.argv.slice(2), {
  5. 'boolean': [
  6. 'help',
  7. 'pre-auto-entitlements',
  8. 'pre-embed-provisioning-profile',
  9. 'gatekeeper-assess'
  10. ],
  11. 'default': {
  12. 'pre-auto-entitlements': true,
  13. 'pre-embed-provisioning-profile': true,
  14. 'gatekeeper-assess': true
  15. }
  16. })
  17. var usage = fs.readFileSync(path.join(__dirname, 'electron-osx-sign-usage.txt')).toString()
  18. var sign = require('../').sign
  19. args.app = args._.shift()
  20. args.binaries = args._
  21. if (!args.app || args.help) {
  22. console.log(usage)
  23. process.exit(0)
  24. }
  25. // Remove excess arguments
  26. delete args._
  27. delete args.help
  28. sign(args, function done (err) {
  29. if (err) {
  30. console.error('Sign failed:')
  31. if (err.message) console.error(err.message)
  32. else if (err.stack) console.error(err.stack)
  33. else console.log(err)
  34. process.exit(1)
  35. }
  36. console.log('Application signed:', args.app)
  37. process.exit(0)
  38. })