Components: Handle extended set of git path prefixes #2945
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per the document linked in the function description, valid git URLs may begin with ssh:// (and ftp://). This PR extends the nf-core tool to clone module repositories that are of these forms.
Before this fix, running a command like
would pass the string
ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/modules.git
to therepo_full_name_from_remote
function which would return the repo full name/v1/repos/modules
, which would be passed to thegit clone
subshell to invoke the command trying togit clone
into the root of the filesystem, which is going to fail for almost all users:This amended function now returns the string
v1/repos/modules
instead, which should allow the repo to be cloned correctly because it is no longer an absolute path.