Skip to content

Commit

Permalink
still ask before overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Oct 31, 2022
1 parent eff0721 commit e0baf78
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nf_core/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ def launch_pipeline(self):
)
else:
log.warning(f"Parameter output file already exists! {os.path.relpath(self.params_out)}")
if Confirm.ask("[yellow]Do you want to overwrite this file?"):
if Confirm.ask("[yellow]Do you want to overwrite this file?"):
if not (self.params_in and os.path.abspath(self.params_in) == os.path.abspath(self.params_out)):
os.remove(self.params_out)
log.info(f"Deleted {self.params_out}\n")
else:
log.info("Exiting. Use --params-out to specify a custom filename.")
return False
else:
log.info("Exiting. Use --params-out to specify a custom output filename.")
return False

log.info(
"NOTE: This tool ignores any pipeline parameter defaults overwritten by Nextflow config files or profiles\n"
Expand Down

0 comments on commit e0baf78

Please sign in to comment.