...
This commit is contained in:
@@ -91,7 +91,7 @@ import incubaid.herolib.develop.gittools
|
||||
// git_pull bool
|
||||
// currentdir bool // can use currentdir, if true, will use current directory as base path if not giturl or path specified
|
||||
mydocs_path:=gittools.path(
|
||||
pull:true,
|
||||
git_pull:true,
|
||||
git_url:'https://git.threefold.info/tfgrid/info_docs_depin/src/branch/main/docs'
|
||||
)!
|
||||
|
||||
|
||||
@@ -145,3 +145,25 @@ fn normalize_url(url string) string {
|
||||
}
|
||||
return url.replace(':', '/').replace('//', '/').trim('/')
|
||||
}
|
||||
|
||||
pub fn (self GitLocation) web_url() !string {
|
||||
println(self)
|
||||
mut provider := self.provider
|
||||
if provider == 'github' {
|
||||
provider = 'github.com'
|
||||
}
|
||||
mut url_base := 'https://${provider}/${self.account}/${self.name}'
|
||||
mut url := '${url_base}/src/branch/${self.branch_or_tag}/${self.path}'
|
||||
// if provider.contains('gitea') || provider.contains('git.') {
|
||||
// url = '${url_base}/src/branch/${self.branch_or_tag}/${self.path}'
|
||||
// }
|
||||
// if provider == 'github' {
|
||||
// return '${url_base}/edit/${self.branch_or_tag}/${self.path}'
|
||||
// }
|
||||
// if provider == 'gitlab' {
|
||||
// return '${url_base}/-/edit/${self.branch_or_tag}/${self.path}'
|
||||
// }
|
||||
println(url)
|
||||
$dbg;
|
||||
return url
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user