diff options
-rw-r--r-- | lib/spack/spack/cmd/checksum.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py index e3e9c1a308..44478c61ce 100644 --- a/lib/spack/spack/cmd/checksum.py +++ b/lib/spack/spack/cmd/checksum.py @@ -183,7 +183,7 @@ def checksum(parser, args): print() if args.add_to_package: - add_versions_to_package(pkg, version_lines) + add_versions_to_package(pkg, version_lines, args.batch) def print_checksum_status(pkg: PackageBase, version_hashes: dict): @@ -229,7 +229,7 @@ def print_checksum_status(pkg: PackageBase, version_hashes: dict): tty.die("Invalid checksums found.") -def add_versions_to_package(pkg: PackageBase, version_lines: str): +def add_versions_to_package(pkg: PackageBase, version_lines: str, is_batch: bool): """ Add checksumed versions to a package's instructions and open a user's editor so they may double check the work of the function. @@ -282,5 +282,5 @@ def add_versions_to_package(pkg: PackageBase, version_lines: str): tty.msg(f"Added {num_versions_added} new versions to {pkg.name}") tty.msg(f"Open {filename} to review the additions.") - if sys.stdout.isatty(): + if sys.stdout.isatty() and not is_batch: editor(filename) |