This commit is contained in:
2025-10-26 18:14:32 +04:00
parent 79f2752b30
commit b85ac9adc9
14 changed files with 598 additions and 855 deletions

View File

@@ -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'
)!

View File

@@ -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
}