Skip to content

Commit

Permalink
Infer source URLs for remote paths (#17)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
robnewman authored Oct 18, 2023
1 parent 2e88da8 commit 8413b1b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions plugins/nf-prov/src/main/nextflow/prov/PathNormalizer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@ class PathNormalizer {
* @param path
*/
private String getProjectSourceUrl(String path) {
// TODO: add other git providers
if( repository.host == 'github.com' )
switch( repository.host ) {
case 'bitbucket.org':
return path.replace(projectDir, "${repository}/src/${commitId}")
case 'github.com':
return path.replace(projectDir, "${repository}/tree/${commitId}")
else
case 'gitlab.com':
return path.replace(projectDir, "${repository}/-/tree/${commitId}")
default:
return path
}
}

}

0 comments on commit 8413b1b

Please sign in to comment.