diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-05-13 14:53:05 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-05-13 14:53:05 +0200 |
| commit | a25b222b2e5d549cc9bd14639442ea176554cdd1 (patch) | |
| tree | e739e869c9f1946b0fe9528d3d429f40929e75cf | |
| parent | 055db95bf628c64dc8f24c3aca573ea453de9aa5 (diff) | |
Various fixes to notarize command that should have been squashed.
| -rwxr-xr-x | cdist | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -797,8 +797,8 @@ class OSXTarget(Target): if notarize: notarize_dmg(x[0], x[1]) else: - with f as f.open(dmg + '.id', 'w'): - print(out=f, x[1]) + with open(dmg + '.id', 'w') as f: + print(x[1], out=f) return [x[0] for x in p] @@ -1205,7 +1205,7 @@ def main(): if not os.path.exists(args.work): os.makedirs(args.work) - if args.project is None and args.command != 'shell': + if args.project is None and not args.command in ['shell', 'notarize']: raise Error('you must specify -p or --project') globals.quiet = args.quiet @@ -1388,15 +1388,13 @@ def main(): elif args.command == 'notarize': if args.dmgs is None: raise Error('you must specify ---dmgs') - if args.no_notarize: - raise Error('it makes no sense to pass --no-notarize with the notarize command') - for dmg in Path(args.dmgs).iter(): + for dmg in Path(args.dmgs).glob('*.dmg'): id = None try: - with open(dmg + '.id') as f: - id = f.getline().strip() - catch OSError: + with open(str(dmg) + '.id') as f: + id = f.readline().strip() + except OSError: raise Error('could not find ID file for %s' % dmg) notarize_dmg(dmg, id) |
