push
This commit is contained in:
@@ -4,6 +4,6 @@
|
|||||||
import os
|
import os
|
||||||
import freeflowuniverse.herolib.develop.gittools
|
import freeflowuniverse.herolib.develop.gittools
|
||||||
|
|
||||||
mut gs := gittools.get(reload:false)!
|
mut gs := gittools.get(reload:true)!
|
||||||
|
|
||||||
gs.repos_print()!
|
gs.repos_print()!
|
||||||
@@ -24,7 +24,7 @@ pub fn (mut plbook PlayBook) add(args_ PlayBookNewArgs) ! {
|
|||||||
pull: args.git_pull
|
pull: args.git_pull
|
||||||
reset: args.git_reset
|
reset: args.git_reset
|
||||||
)!
|
)!
|
||||||
args.path = repo.get_path()!
|
args.path = repo.path()
|
||||||
}
|
}
|
||||||
|
|
||||||
// walk over directory
|
// walk over directory
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ fn (mut self GitStructure) coderoot() !pathlib.Path {
|
|||||||
////// CONFIG
|
////// CONFIG
|
||||||
|
|
||||||
// Load config from redis
|
// Load config from redis
|
||||||
fn (mut self GitStructure) config() !GitStructureConfig {
|
pub fn (mut self GitStructure) config() !GitStructureConfig {
|
||||||
mut config := self.config_ or {
|
mut config := self.config_ or {
|
||||||
mut redis := redis_get()
|
mut redis := redis_get()
|
||||||
data:=redis.get("${self.cache_key()}:config")!
|
data:=redis.get("${self.cache_key()}:config")!
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ pub fn (mut repo GitRepo) need_push_or_pull() !bool {
|
|||||||
last_local_commit := repo.get_last_local_commit() or {
|
last_local_commit := repo.get_last_local_commit() or {
|
||||||
return error('Failed to get last local commit: ${err}')
|
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
|
return last_local_commit != last_remote_commit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ pub fn (repo GitRepo) patho() !pathlib.Path {
|
|||||||
// gets the path of a given url within a repo
|
// 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'
|
// ex: 'https://git.ourworld.tf/ourworld_holding/info_ourworld/src/branch/main/books/cocreation/SUMMARY.md'
|
||||||
// returns <repo_path>/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
|
// Split the URL into components
|
||||||
url_parts := url.split('/')
|
url_parts := url.split('/')
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ pub fn load(url string) !LuaDNS {
|
|||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
|
|
||||||
repo_path := repo.get_path()!
|
repo_path := repo.path()
|
||||||
|
|
||||||
return LuaDNS{
|
return LuaDNS{
|
||||||
url: url
|
url: url
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import freeflowuniverse.herolib.develop.gittools
|
|||||||
pub fn (dns LuaDNS) directory() !pathlib.Path {
|
pub fn (dns LuaDNS) directory() !pathlib.Path {
|
||||||
mut gs := gittools.new()!
|
mut gs := gittools.new()!
|
||||||
mut repo := gs.get_repo(url: dns.url, pull: true)!
|
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)!
|
return pathlib.get_dir(path: repo_path)!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ fn play_book_publish(p Params) ! {
|
|||||||
|
|
||||||
fn get_summary_path(summary_url string) !string {
|
fn get_summary_path(summary_url string) !string {
|
||||||
mut gs := gittools.get()!
|
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
|
// get the path corresponding to the summary_url dir/file
|
||||||
summary_path := repo.get_path_of_url(summary_url)!
|
summary_path := repo.get_path_of_url(summary_url)!
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ pub fn build_() ! {
|
|||||||
reset: false
|
reset: false
|
||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
path := repo.get_path()!
|
path := repo.path()
|
||||||
cmd := '
|
cmd := '
|
||||||
set -ex
|
set -ex
|
||||||
cd ${path}
|
cd ${path}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ pub fn install_() ! {
|
|||||||
|
|
||||||
mut gs := gittools.new()!
|
mut gs := gittools.new()!
|
||||||
mut repo := gs.get_repo(url: 'https://github.com/threefoldtech/rfs', reset: true)!
|
mut repo := gs.get_repo(url: 'https://github.com/threefoldtech/rfs', reset: true)!
|
||||||
path := repo.get_path()!
|
path := repo.path()
|
||||||
cmd := '
|
cmd := '
|
||||||
cd ${path}
|
cd ${path}
|
||||||
rustup target add x86_64-unknown-linux-musl
|
rustup target add x86_64-unknown-linux-musl
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ pub fn configure(args_ InstallArgs) ! {
|
|||||||
mut repo := gs.get_repo(
|
mut repo := gs.get_repo(
|
||||||
url: args.config_url
|
url: args.config_url
|
||||||
)!
|
)!
|
||||||
repo_path = repo.get_path()!
|
repo_path = repo.path()
|
||||||
|
|
||||||
args.config_path = repo_path
|
args.config_path = repo_path
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ pub fn configure(args_ InstallArgs) ! {
|
|||||||
mut repo := gs.get_repo(
|
mut repo := gs.get_repo(
|
||||||
url: args.dnszones_url
|
url: args.dnszones_url
|
||||||
)!
|
)!
|
||||||
repo_path = repo.get_path()!
|
repo_path = repo.path()
|
||||||
args.dnszones_path = repo_path
|
args.dnszones_path = repo_path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ fn build() ! {
|
|||||||
reset: true
|
reset: true
|
||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
gitpath := repo.get_path()!
|
gitpath := repo.path()
|
||||||
|
|
||||||
// source ${osal.profile_path()}
|
// source ${osal.profile_path()}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ pub fn install(args InstallArgs) ! {
|
|||||||
vlang.v_analyzer_install(reset: args.reset)!
|
vlang.v_analyzer_install(reset: args.reset)!
|
||||||
|
|
||||||
mut gs := gittools.get()!
|
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(
|
mut repo := gs.get_repo(
|
||||||
pull: args.git_pull
|
pull: args.git_pull
|
||||||
@@ -44,7 +44,7 @@ pub fn install(args InstallArgs) ! {
|
|||||||
// url: 'https://github.com/freeflowuniverse/webcomponents/tree/main/webcomponents'
|
// url: 'https://github.com/freeflowuniverse/webcomponents/tree/main/webcomponents'
|
||||||
// )!
|
// )!
|
||||||
|
|
||||||
mut path1 := repo.get_path()!
|
mut path1 := repo.path()
|
||||||
// mut path2 := repo2.get_path()!
|
// mut path2 := repo2.get_path()!
|
||||||
|
|
||||||
mut path1p := pathlib.get_dir(path: path1, create: false)!
|
mut path1p := pathlib.get_dir(path: path1, create: false)!
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ pub fn install(args_ InstallArgs) ! {
|
|||||||
url: 'https://github.com/vlang/v/tree/master'
|
url: 'https://github.com/vlang/v/tree/master'
|
||||||
)!
|
)!
|
||||||
|
|
||||||
mut path1 := repo.get_path()!
|
mut path1 := repo.path()
|
||||||
|
|
||||||
mut extra := ''
|
mut extra := ''
|
||||||
if core.is_linux()! {
|
if core.is_linux()! {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Peers:
|
|||||||
reset: false
|
reset: false
|
||||||
)!
|
)!
|
||||||
|
|
||||||
mut path := repo.get_path()!
|
mut path := repo.path()
|
||||||
|
|
||||||
osal.exec(cmd: 'cd ${path} && PATH=\$PATH:/usr/local/go/bin ./build')!
|
osal.exec(cmd: 'cd ${path} && PATH=\$PATH:/usr/local/go/bin ./build')!
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ pub fn build_(args BuildArgs) ! {
|
|||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
|
|
||||||
mut gitpath := repo.get_path()!
|
mut gitpath := repo.path()
|
||||||
|
|
||||||
cmd := '
|
cmd := '
|
||||||
source ~/.cargo/env
|
source ~/.cargo/env
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ pub fn build_(args BuildArgs) ! {
|
|||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
|
|
||||||
mut path := repo.get_path()!
|
mut path := repo.path()
|
||||||
|
|
||||||
cmd := '
|
cmd := '
|
||||||
set -ex
|
set -ex
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ fn build_() ! {
|
|||||||
reset: true
|
reset: true
|
||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
gitpath := repo.get_path()!
|
gitpath := repo.path()
|
||||||
|
|
||||||
// source ${osal.profile_path()!}
|
// source ${osal.profile_path()!}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ fn build_() ! {
|
|||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
|
|
||||||
mut path := repo.get_path()!
|
mut path := repo.path()
|
||||||
path = '${path}/griddriver'
|
path = '${path}/griddriver'
|
||||||
|
|
||||||
cmd := '/bin/bash -c "cd ${path} && . ${path}/build.sh"'
|
cmd := '/bin/bash -c "cd ${path} && . ${path}/build.sh"'
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ pub fn build_() ! {
|
|||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
|
|
||||||
mut path := repo.get_path()!
|
mut path := repo.path()
|
||||||
|
|
||||||
cmd := '
|
cmd := '
|
||||||
cd ${path}
|
cd ${path}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ fn build_() ! {
|
|||||||
pull: true
|
pull: true
|
||||||
)!
|
)!
|
||||||
|
|
||||||
mut gitpath := repo.get_path()!
|
mut gitpath := repo.path()
|
||||||
|
|
||||||
cmd := '
|
cmd := '
|
||||||
cd ${gitpath}
|
cd ${gitpath}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ pub fn new(args_ SimulatorArgs) !Simulator {
|
|||||||
reload: false
|
reload: false
|
||||||
)!
|
)!
|
||||||
|
|
||||||
args.path = repo.get_path()!
|
args.path = repo.path()
|
||||||
}
|
}
|
||||||
|
|
||||||
if args.path.len > 0 {
|
if args.path.len > 0 {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ pub fn new(args_ SimulatorArgs) !Simulator {
|
|||||||
reload: false
|
reload: false
|
||||||
)!
|
)!
|
||||||
|
|
||||||
args.path = repo.get_path()!
|
args.path = repo.path()
|
||||||
}
|
}
|
||||||
|
|
||||||
simulator_set(sim)
|
simulator_set(sim)
|
||||||
|
|||||||
Reference in New Issue
Block a user