This commit is contained in:
2025-01-23 14:16:02 +01:00
parent 6637756088
commit 888aac4867
23 changed files with 25 additions and 25 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -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 <repo_path>/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('/')

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,7 @@ pub fn build_() ! {
reset: false
pull: true
)!
path := repo.get_path()!
path := repo.path()
cmd := '
set -ex
cd ${path}

View File

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

View File

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

View File

@@ -69,7 +69,7 @@ fn build() ! {
reset: true
pull: true
)!
gitpath := repo.get_path()!
gitpath := repo.path()
// source ${osal.profile_path()}

View File

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

View File

@@ -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()! {

View File

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

View File

@@ -33,7 +33,7 @@ pub fn build_(args BuildArgs) ! {
pull: true
)!
mut gitpath := repo.get_path()!
mut gitpath := repo.path()
cmd := '
source ~/.cargo/env

View File

@@ -32,7 +32,7 @@ pub fn build_(args BuildArgs) ! {
pull: true
)!
mut path := repo.get_path()!
mut path := repo.path()
cmd := '
set -ex

View File

@@ -68,7 +68,7 @@ fn build_() ! {
reset: true
pull: true
)!
gitpath := repo.get_path()!
gitpath := repo.path()
// source ${osal.profile_path()!}

View File

@@ -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"'

View File

@@ -55,7 +55,7 @@ pub fn build_() ! {
pull: true
)!
mut path := repo.get_path()!
mut path := repo.path()
cmd := '
cd ${path}

View File

@@ -50,7 +50,7 @@ fn build_() ! {
pull: true
)!
mut gitpath := repo.get_path()!
mut gitpath := repo.path()
cmd := '
cd ${gitpath}

View File

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

View File

@@ -59,7 +59,7 @@ pub fn new(args_ SimulatorArgs) !Simulator {
reload: false
)!
args.path = repo.get_path()!
args.path = repo.path()
}
simulator_set(sim)