Skip to content

Commit

Permalink
Refine profile serialization validation logic in CLI a bit more.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedarcy committed Jul 25, 2023
1 parent 6f40683 commit fdb56f3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bdbag/bdbag_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def main():
args, path, is_bag, is_file, is_uri = parse_cli()

archive = None
profile = None
temp_path = None
error = None
result = 0
Expand Down Expand Up @@ -402,10 +403,12 @@ def main():
if archive is None and is_file:
archive = path

if args.validate_profile == "full" and is_file:
if not temp_path:
temp_path = bdb.extract_bag(path, args.output_path, temp=args.output_path is None)
profile = bdb.validate_bag_profile(temp_path if temp_path else path, profile_path=args.profile_path)
if args.validate_profile == "full":
if is_file:
if not temp_path:
temp_path = bdb.extract_bag(path, args.output_path, temp=args.output_path is None)
if not profile:
profile = bdb.validate_bag_profile(temp_path if temp_path else path, profile_path=args.profile_path)
bdb.validate_bag_serialization(archive if archive else path, profile)

if args.revert:
Expand Down

0 comments on commit fdb56f3

Please sign in to comment.