Skip to content

Commit

Permalink
Handle exception in nf-core list when a broken git repo is found
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed Mar 14, 2022
1 parent ae06289 commit 2f2cb0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* Switch to `yamllint-github-action`to be able to configure yaml lint exceptions ([#1404](https://github.com/nf-core/tools/issues/1413))
* Prevent module linting KeyError edge case ([#1321](https://github.com/nf-core/tools/issues/1321))
* Bump-versions: Don't trim the trailing newline on files, causes editorconfig linting to fail ([#1265](https://github.com/nf-core/tools/issues/1265))
* Handle exception in `nf-core list` when a broken git repo is found ([#1273](https://github.com/nf-core/tools/issues/1273))

### Modules

Expand Down
12 changes: 6 additions & 6 deletions nf_core/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,13 @@ def get_local_nf_workflow_details(self):
self.active_tag = str(tag)

# I'm not sure that we need this any more, it predated the self.branch catch above for detacted HEAD
except TypeError as e:
except (TypeError, git.InvalidGitRepositoryError) as e:
log.error(
"Could not fetch status of local Nextflow copy of {}:".format(self.full_name)
+ "\n {}".format(str(e))
+ "\n\nIt's probably a good idea to delete this local copy and pull again:".format(self.local_path)
+ "\n rm -rf {}".format(self.local_path)
+ "\n nextflow pull {}".format(self.full_name)
f"Could not fetch status of local Nextflow copy of '{self.full_name}':"
f"\n [red]{type(e).__name__}:[/] {str(e)}"
"\n\nIt's probably a good idea to delete this local copy and pull again:"
f"\n [magenta]rm -rf {self.local_path}"
f"\n [magenta]nextflow pull {self.full_name}",
)


Expand Down

0 comments on commit 2f2cb0b

Please sign in to comment.