Skip to content

Commit

Permalink
fix: send the properly formatted options from the CLI to electron-osx…
Browse files Browse the repository at this point in the history
…-sign (#1047)
  • Loading branch information
jhen0409 authored and malept committed Sep 9, 2019
1 parent 4ed0a4b commit 1bb9edd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ module.exports = {
if (args.osxSign === 'true') {
warning('--osx-sign does not take any arguments, it only has sub-properties (see --help)')
args.osxSign = true
} else if (typeof args.osxSign === 'object' && !Array.isArray(args.osxSign)) {
// Keep kebab case of sub properties
args.osxSign = args['osx-sign']
}

if (args.osxNotarize) {
Expand Down
11 changes: 11 additions & 0 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ test('CLI argument: --osx-sign=true', t => {
t.true(args.osxSign)
})

test('CLI argument: --osx-sign is object', t => {
const args = cli.parseArgs([
'--osx-sign.identity=identity',
'--osx-sign.entitlements-inherit=path',
'--osx-sign.hardenedRuntime'
])
t.is(args.osxSign.identity, 'identity')
t.is(args.osxSign['entitlements-inherit'], 'path')
t.true(args.osxSign.hardenedRuntime)
})

test('CLI argument: --osx-notarize=true', t => {
const args = cli.parseArgs(['--osx-notarize=true'])
t.falsy(args.osxNotarize, '')
Expand Down

0 comments on commit 1bb9edd

Please sign in to comment.