electron-osx-sign
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -7,3 +7,5 @@ #!/usr/bin/env node | ||
if (!args._[0] || args.help) { | ||
args.app = args._[0] | ||
if (!args.app || args.help) { | ||
console.log(usage) | ||
@@ -13,3 +15,3 @@ process.exit(0) | ||
sign(args._[0], args, function done (err) { | ||
sign(args, function done (err) { | ||
if (err) { | ||
@@ -16,0 +18,0 @@ console.error('Sign failed.') |
10
index.js
@@ -159,9 +159,7 @@ var fs = require('fs') | ||
module.exports = function sign (app, opts, cb) { | ||
if (!opts) opts = {} | ||
if (!cb) cb = function () {} | ||
opts.app = app | ||
module.exports = function sign (opts, cb) { | ||
if (!opts.app) return cb(new Error('Path to aplication must be specified.')) | ||
if (!fs.existsSync(opts.app)) return cb(new Error('Application not found.')) | ||
if (!cb) cb = function () {} | ||
// Match platform if none is provided | ||
@@ -221,3 +219,3 @@ if (!opts.platform) { | ||
}) | ||
} | ||
} else cb() | ||
} | ||
@@ -224,0 +222,0 @@ ], function (err) { |
{ | ||
"name": "electron-osx-sign", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Codesign for Electron-packed apps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,19 +25,42 @@ # electron-osx-sign [![npm][npm_img]][npm_url] | ||
Example: | ||
```sh | ||
electron-osx-sign path/to/my.app | ||
``` | ||
For details on the optional flags, run `electron-osx-sign --help` or see [usage.txt](https://github.com/sethlu/electron-sign/blob/master/usage.txt). | ||
### Programmatic API | ||
### From the API | ||
```javascript | ||
var sign = require('electron-osx-sign') | ||
sign(app[, opts[, function done (err) { }]]) | ||
sign(opts[, function done (err) { }]) | ||
``` | ||
#### sign(app, opts, callback) | ||
Example: | ||
##### app | ||
```javascript | ||
var sign = require('electron-osx-sign') | ||
sign({ | ||
app: 'path/to/my.app' | ||
}, function done (err) { | ||
if (err) { | ||
// Handle the error | ||
return; | ||
} | ||
// Regular callback | ||
}) | ||
``` | ||
Path to the application | ||
#### sign(opts, callback) | ||
##### opts | ||
**Required** | ||
`app` - *String* | ||
Path to the application package. | ||
**Optional** | ||
@@ -89,2 +112,6 @@ | ||
## Frequently Raised Issues | ||
If error persists with `A timestamp was expected but was not found.` or `The timestamp service is not available.`, please try code sign the application later. The intermittent nature of the failures is a networking issue in communicating with the timestamp server. | ||
## Test | ||
@@ -107,3 +134,3 @@ | ||
> electron-sign@0.1.1 test electron-osx-sign | ||
> electron-sign@0.1.4 test electron-osx-sign | ||
> standard && tape test | ||
@@ -110,0 +137,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21289
186
361