Skip to content

Commit

Permalink
Restore previously broken behavior in the CLI that allows bag and pro…
Browse files Browse the repository at this point in the history
…file validation to be chained into a bag creation command.

Update CLI docs with `--profile-path` clarifications.
  • Loading branch information
mikedarcy committed Jul 25, 2023
1 parent b19f242 commit 6f40683
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bdbag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

logger = logging.getLogger(__name__)

__version__ = "1.7.0dev5"
__version__ = "1.7.0dev6"
__bagit_version__ = "1.8.1"
__bagit_profile_version__ = "1.3.1"

Expand Down
2 changes: 1 addition & 1 deletion bdbag/bdbag_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def main():
if not is_file:
# do not try to create or update the bag if the user just wants to validate or complete an existing bag
if not ((args.validate or args.validate_profile or args.resolve_fetch)
and not (args.update and bdb.is_bag(path))):
and not (args.update and bdb.is_bag(path))) or not bdb.is_bag(path):
if args.checksum and 'all' in args.checksum:
args.checksum = ['md5', 'sha1', 'sha256', 'sha512']
# create or update the bag depending on the input arguments
Expand Down
3 changes: 2 additions & 1 deletion doc/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Validate a bag against the profile specified by the bag's `BagIt-Profile-Identif
#### `--profile-path <file>`
Optional path to a `Bagit-Profiles-Specification` JSON file. The file format is described
[here](https://bagit-profiles.github.io/bagit-profiles-specification/).
If this argument is not specified, the profile specified by the bag's `BagIt-Profile-Identifier` metadata field will be used, if present.
If this argument is not specified, the profile specified by the bag's `BagIt-Profile-Identifier` metadata field will be used.

----
#### `--config-file <file>`
Expand Down Expand Up @@ -256,6 +256,7 @@ This following table enumerates the various arguments and compatibility modes.
| `--fetch-filter` | bag dir only, fetch only | A fetch filter is only relevant during a `--resolve-fetch`. |
| `--validate` | all | A bag directory or a bag archive can be validated. If a bag archive is to be validated, it is first extracted from the archive to a temporary directory and validated, then the temporary directory is removed. |
| `--validate-profile` | all | A bag directory or a bag archive can have its profile validated. If a bag archive is to have its profile validated, it is first extracted from the archive to a temporary directory and validated, then the temporary directory is removed. |
| `--profile-path` | bag dir or bag file, only used with `--validate-profile` | A local profile path is only valid in the context of a `--validate-profile` operation. |
| `--config-file` | bag dir only, create or update only | A config-file override can be specified whenever a bag is created or updated. |
| `--keychain-file` | bag dir only, used only when `--resolve-fetch` is specified | This argument is only meaningful in the context of remote file resolution. |
| `--metadata-file` | bag dir only, create or update only | A metadata config file can be specified whenever a bag is created or updated. |
Expand Down

0 comments on commit 6f40683

Please sign in to comment.