Allow --overwrite and --log-format to be used together
Restructure the logic of the spack install command to allow these two command-line arguments to be used at the same time.
This commit is contained in:
parent
6c5dbdd9cd
commit
de01d70ae4
@ -216,6 +216,8 @@ def install(parser, args, **kwargs):
|
|||||||
if len(specs) == 0:
|
if len(specs) == 0:
|
||||||
tty.die('The `spack install` command requires a spec to install.')
|
tty.die('The `spack install` command requires a spec to install.')
|
||||||
|
|
||||||
|
filename = args.log_file or default_log_file(specs[0])
|
||||||
|
with spack.report.collect_info(specs, args.log_format, filename):
|
||||||
if args.overwrite:
|
if args.overwrite:
|
||||||
# If we asked to overwrite an existing spec we must ensure that:
|
# If we asked to overwrite an existing spec we must ensure that:
|
||||||
# 1. We have only one spec
|
# 1. We have only one spec
|
||||||
@ -249,8 +251,5 @@ def install(parser, args, **kwargs):
|
|||||||
install_spec(args, kwargs, specs[0])
|
install_spec(args, kwargs, specs[0])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
filename = args.log_file or default_log_file(specs[0])
|
|
||||||
with spack.report.collect_info(specs, args.log_format, filename):
|
|
||||||
for spec in specs:
|
for spec in specs:
|
||||||
install_spec(args, kwargs, spec)
|
install_spec(args, kwargs, spec)
|
||||||
|
Loading…
Reference in New Issue
Block a user