diff --git a/examples/develop/gittools/example3.vsh b/examples/develop/gittools/example3.vsh index 34af18c8..5744b7f4 100755 --- a/examples/develop/gittools/example3.vsh +++ b/examples/develop/gittools/example3.vsh @@ -4,6 +4,6 @@ import os import freeflowuniverse.herolib.develop.gittools -mut gs := gittools.get(reload:false)! +mut gs := gittools.get(reload:true)! gs.repos_print()! \ No newline at end of file diff --git a/lib/core/playbook/playbook_add.v b/lib/core/playbook/playbook_add.v index 9e49808e..ca2b6d9c 100644 --- a/lib/core/playbook/playbook_add.v +++ b/lib/core/playbook/playbook_add.v @@ -24,7 +24,7 @@ pub fn (mut plbook PlayBook) add(args_ PlayBookNewArgs) ! { pull: args.git_pull reset: args.git_reset )! - args.path = repo.get_path()! + args.path = repo.path() } // walk over directory diff --git a/lib/develop/gittools/gitstructure.v b/lib/develop/gittools/gitstructure.v index 295fac20..9c627110 100644 --- a/lib/develop/gittools/gitstructure.v +++ b/lib/develop/gittools/gitstructure.v @@ -238,7 +238,7 @@ fn (mut self GitStructure) coderoot() !pathlib.Path { ////// CONFIG // Load config from redis -fn (mut self GitStructure) config() !GitStructureConfig { +pub fn (mut self GitStructure) config() !GitStructureConfig { mut config := self.config_ or { mut redis := redis_get() data:=redis.get("${self.cache_key()}:config")! diff --git a/lib/develop/gittools/repository_info.v b/lib/develop/gittools/repository_info.v index 5cea439d..c9675921 100644 --- a/lib/develop/gittools/repository_info.v +++ b/lib/develop/gittools/repository_info.v @@ -58,7 +58,7 @@ pub fn (mut repo GitRepo) need_push_or_pull() !bool { last_local_commit := repo.get_last_local_commit() or { return error('Failed to get last local commit: ${err}') } - println('commit status: ${repo.name} ${last_local_commit} ${last_remote_commit}') + //println('commit status: ${repo.name} ${last_local_commit} ${last_remote_commit}') return last_local_commit != last_remote_commit } diff --git a/lib/develop/gittools/repository_utils.v b/lib/develop/gittools/repository_utils.v index 79539172..d2f9c765 100644 --- a/lib/develop/gittools/repository_utils.v +++ b/lib/develop/gittools/repository_utils.v @@ -34,7 +34,7 @@ pub fn (repo GitRepo) patho() !pathlib.Path { // gets the path of a given url within a repo // ex: 'https://git.ourworld.tf/ourworld_holding/info_ourworld/src/branch/main/books/cocreation/SUMMARY.md' // returns /books/cocreation/SUMMARY.md -fn (mut repo GitRepo) get_path_of_url(url string) !string { +pub fn (mut repo GitRepo) get_path_of_url(url string) !string { // Split the URL into components url_parts := url.split('/') diff --git a/lib/develop/luadns/factory.v b/lib/develop/luadns/factory.v index 2817d72c..ad672c4a 100644 --- a/lib/develop/luadns/factory.v +++ b/lib/develop/luadns/factory.v @@ -16,7 +16,7 @@ pub fn load(url string) !LuaDNS { pull: true )! - repo_path := repo.get_path()! + repo_path := repo.path() return LuaDNS{ url: url diff --git a/lib/develop/luadns/luadns.v b/lib/develop/luadns/luadns.v index 0f792399..7f853db6 100644 --- a/lib/develop/luadns/luadns.v +++ b/lib/develop/luadns/luadns.v @@ -7,7 +7,7 @@ import freeflowuniverse.herolib.develop.gittools pub fn (dns LuaDNS) directory() !pathlib.Path { mut gs := gittools.new()! mut repo := gs.get_repo(url: dns.url, pull: true)! - repo_path := repo.get_path()! + repo_path := repo.path() return pathlib.get_dir(path: repo_path)! } diff --git a/lib/hero/publishing/play.v b/lib/hero/publishing/play.v index 35a98431..b6549310 100644 --- a/lib/hero/publishing/play.v +++ b/lib/hero/publishing/play.v @@ -100,7 +100,7 @@ fn play_book_publish(p Params) ! { fn get_summary_path(summary_url string) !string { mut gs := gittools.get()! - repo := gs.get_repo(url: summary_url, reset: false, pull: false)! + mut repo := gs.get_repo(url: summary_url, reset: false, pull: false)! // get the path corresponding to the summary_url dir/file summary_path := repo.get_path_of_url(summary_url)! diff --git a/lib/installers/db/zerodb/zdb_builder.v b/lib/installers/db/zerodb/zdb_builder.v index 57753842..601a0ba7 100644 --- a/lib/installers/db/zerodb/zdb_builder.v +++ b/lib/installers/db/zerodb/zdb_builder.v @@ -16,7 +16,7 @@ pub fn build_() ! { reset: false pull: true )! - path := repo.get_path()! + path := repo.path() cmd := ' set -ex cd ${path} diff --git a/lib/installers/db/zerofs/rfs.v b/lib/installers/db/zerofs/rfs.v index d932f007..f444feee 100644 --- a/lib/installers/db/zerofs/rfs.v +++ b/lib/installers/db/zerofs/rfs.v @@ -15,7 +15,7 @@ pub fn install_() ! { mut gs := gittools.new()! mut repo := gs.get_repo(url: 'https://github.com/threefoldtech/rfs', reset: true)! - path := repo.get_path()! + path := repo.path() cmd := ' cd ${path} rustup target add x86_64-unknown-linux-musl diff --git a/lib/installers/infra/coredns/cdns_configure.v b/lib/installers/infra/coredns/cdns_configure.v index b9be9944..57cadce6 100644 --- a/lib/installers/infra/coredns/cdns_configure.v +++ b/lib/installers/infra/coredns/cdns_configure.v @@ -13,7 +13,7 @@ pub fn configure(args_ InstallArgs) ! { mut repo := gs.get_repo( url: args.config_url )! - repo_path = repo.get_path()! + repo_path = repo.path() args.config_path = repo_path } @@ -26,7 +26,7 @@ pub fn configure(args_ InstallArgs) ! { mut repo := gs.get_repo( url: args.dnszones_url )! - repo_path = repo.get_path()! + repo_path = repo.path() args.dnszones_path = repo_path } diff --git a/lib/installers/infra/zinit/zinit_actions.v b/lib/installers/infra/zinit/zinit_actions.v index 1b0758cf..a4b2ddc1 100644 --- a/lib/installers/infra/zinit/zinit_actions.v +++ b/lib/installers/infra/zinit/zinit_actions.v @@ -69,7 +69,7 @@ fn build() ! { reset: true pull: true )! - gitpath := repo.get_path()! + gitpath := repo.path() // source ${osal.profile_path()} diff --git a/lib/installers/lang/herolib/crystallib.v b/lib/installers/lang/herolib/crystallib.v index dc2e7fd4..d1db7665 100644 --- a/lib/installers/lang/herolib/crystallib.v +++ b/lib/installers/lang/herolib/crystallib.v @@ -30,7 +30,7 @@ pub fn install(args InstallArgs) ! { vlang.v_analyzer_install(reset: args.reset)! mut gs := gittools.get()! - gs.config.light = true // means we clone depth 1 + gs.config()!.light = true // means we clone depth 1 mut repo := gs.get_repo( pull: args.git_pull @@ -44,7 +44,7 @@ pub fn install(args InstallArgs) ! { // url: 'https://github.com/freeflowuniverse/webcomponents/tree/main/webcomponents' // )! - mut path1 := repo.get_path()! + mut path1 := repo.path() // mut path2 := repo2.get_path()! mut path1p := pathlib.get_dir(path: path1, create: false)! diff --git a/lib/installers/lang/vlang/vlang.v b/lib/installers/lang/vlang/vlang.v index 47267d3d..b148d7a1 100644 --- a/lib/installers/lang/vlang/vlang.v +++ b/lib/installers/lang/vlang/vlang.v @@ -45,7 +45,7 @@ pub fn install(args_ InstallArgs) ! { url: 'https://github.com/vlang/v/tree/master' )! - mut path1 := repo.get_path()! + mut path1 := repo.path() mut extra := '' if core.is_linux()! { diff --git a/lib/installers/net/yggdrasil/ygg.v b/lib/installers/net/yggdrasil/ygg.v index 0a9d51fc..d07f9eee 100644 --- a/lib/installers/net/yggdrasil/ygg.v +++ b/lib/installers/net/yggdrasil/ygg.v @@ -47,7 +47,7 @@ Peers: reset: false )! - mut path := repo.get_path()! + mut path := repo.path() osal.exec(cmd: 'cd ${path} && PATH=\$PATH:/usr/local/go/bin ./build')! diff --git a/lib/installers/sysadmintools/restic/builder.v b/lib/installers/sysadmintools/restic/builder.v index 1cba2d2e..c16e2663 100644 --- a/lib/installers/sysadmintools/restic/builder.v +++ b/lib/installers/sysadmintools/restic/builder.v @@ -33,7 +33,7 @@ pub fn build_(args BuildArgs) ! { pull: true )! - mut gitpath := repo.get_path()! + mut gitpath := repo.path() cmd := ' source ~/.cargo/env diff --git a/lib/installers/sysadmintools/s3/builder.v b/lib/installers/sysadmintools/s3/builder.v index 756d1d5c..f6ca6287 100644 --- a/lib/installers/sysadmintools/s3/builder.v +++ b/lib/installers/sysadmintools/s3/builder.v @@ -32,7 +32,7 @@ pub fn build_(args BuildArgs) ! { pull: true )! - mut path := repo.get_path()! + mut path := repo.path() cmd := ' set -ex diff --git a/lib/installers/sysadmintools/zinit/zinit_actions.v b/lib/installers/sysadmintools/zinit/zinit_actions.v index e4e7660a..b06ac35a 100644 --- a/lib/installers/sysadmintools/zinit/zinit_actions.v +++ b/lib/installers/sysadmintools/zinit/zinit_actions.v @@ -68,7 +68,7 @@ fn build_() ! { reset: true pull: true )! - gitpath := repo.get_path()! + gitpath := repo.path() // source ${osal.profile_path()!} diff --git a/lib/installers/threefold/griddriver/griddriver_actions.v b/lib/installers/threefold/griddriver/griddriver_actions.v index 26d5de9e..9b19c73d 100644 --- a/lib/installers/threefold/griddriver/griddriver_actions.v +++ b/lib/installers/threefold/griddriver/griddriver_actions.v @@ -46,7 +46,7 @@ fn build_() ! { pull: true )! - mut path := repo.get_path()! + mut path := repo.path() path = '${path}/griddriver' cmd := '/bin/bash -c "cd ${path} && . ${path}/build.sh"' diff --git a/lib/installers/threefold/tfrobot/tfrobot.v b/lib/installers/threefold/tfrobot/tfrobot.v index 68d017a4..54a892a1 100644 --- a/lib/installers/threefold/tfrobot/tfrobot.v +++ b/lib/installers/threefold/tfrobot/tfrobot.v @@ -55,7 +55,7 @@ pub fn build_() ! { pull: true )! - mut path := repo.get_path()! + mut path := repo.path() cmd := ' cd ${path} diff --git a/lib/installers/virt/youki/youki_actions.v b/lib/installers/virt/youki/youki_actions.v index 8d31b664..c0f3ebaa 100644 --- a/lib/installers/virt/youki/youki_actions.v +++ b/lib/installers/virt/youki/youki_actions.v @@ -50,7 +50,7 @@ fn build_() ! { pull: true )! - mut gitpath := repo.get_path()! + mut gitpath := repo.path() cmd := ' cd ${gitpath} diff --git a/lib/threefold/grid4/farmingsimulator/factory.v b/lib/threefold/grid4/farmingsimulator/factory.v index 06d3e2bb..4a53e8c8 100644 --- a/lib/threefold/grid4/farmingsimulator/factory.v +++ b/lib/threefold/grid4/farmingsimulator/factory.v @@ -54,7 +54,7 @@ pub fn new(args_ SimulatorArgs) !Simulator { reload: false )! - args.path = repo.get_path()! + args.path = repo.path() } if args.path.len > 0 { diff --git a/lib/threefold/grid4/gridsimulator/factory.v b/lib/threefold/grid4/gridsimulator/factory.v index 94036dd0..5ac238e9 100644 --- a/lib/threefold/grid4/gridsimulator/factory.v +++ b/lib/threefold/grid4/gridsimulator/factory.v @@ -59,7 +59,7 @@ pub fn new(args_ SimulatorArgs) !Simulator { reload: false )! - args.path = repo.get_path()! + args.path = repo.path() } simulator_set(sim)