This commit is contained in:
despiegk 2024-01-13 13:51:29 +00:00
parent 66c12f607d
commit 89ac9c174d
Signed by: despiegk
GPG Key ID: 99E4E1492F73BC18
4 changed files with 37 additions and 22 deletions

View File

@ -113,7 +113,7 @@ def paths_sandbox [] {
} }
def paths_nix [] { def paths_nix [] {
let $mybase = $"($env.BASE)/bin" let $mybase = $"($env.BASE)/bin"
# print $env.PATH # print $env.PATH
# print "====" # print "===="
let envpath = $env.PATH let envpath = $env.PATH
@ -123,15 +123,12 @@ def paths_nix [] {
| append "/usr/sbin" | append "/usr/sbin"
| append "/bin" | append "/bin"
| append "/sbin" | append "/sbin"
| append "/usr/local/bin"
# print $envpath # print $envpath
return $envpath return $envpath
} }
load-env {VMODULES:$"($env.BASE)/.vmodules"}
# path_add | $env.PATH
# load-env {PATH:( path_add | str join ":")}

View File

@ -4,3 +4,4 @@ use tools/runonce.nu
use tools/git.nu use tools/git.nu
use tools/herotools.nu use tools/herotools.nu

View File

@ -16,14 +16,28 @@ def url_crystal [] {
} }
} }
def url_webcomponents [] {
let $ssha = sshagent_loaded
if $ssha {
return "git@github.com:freeflowuniverse/webcomponents.git"
} else {
return "https://github.com/freeflowuniverse/webcomponents"
}
}
export def install_crystal [ --reset=false , --pull=false ] string { export def install_crystal [ --reset=false , --pull=false ] string {
let $vpath = install_v let $vpath = install_v
rm -f $"($env.BASE)/bin/v"
ln -s $"($vpath)/v" $"($env.BASE)/bin/v"
let $url = url_crystal let $url = url_crystal
let $r = git git_clone crystallib $url let $crlibpath = git git_clone crystallib $url --reset=$reset --pull=$pull
# ln -s $"($r)/" let $weburl = url_webcomponents
return $r let $webpath = git git_clone webcomponents $weburl --reset=$reset --pull=$pull
let $vmodpath = $"($env.BASE)/.vmodules"
mkdir $"($vmodpath)/freeflowuniverse"
rm -f $"($vmodpath)/freeflowuniverse/crystallib"
rm -f $"($vmodpath)/freeflowuniverse/webcomponents"
ln -s $"($crlibpath)/crystallib" $"($vmodpath)/freeflowuniverse/crystallib"
ln -s $"($webpath)/webcomponents" $"($vmodpath)/freeflowuniverse/webcomponents"
return $crlibpath
} }
export def clone_nuscripts [ --reset=false , --pull=false ] string { export def clone_nuscripts [ --reset=false , --pull=false ] string {
@ -31,7 +45,7 @@ export def clone_nuscripts [ --reset=false , --pull=false ] string {
let $dest = $"($env.BASE)/nuscripts" let $dest = $"($env.BASE)/nuscripts"
let $dest_org = $"($env.BASE)/nushell" let $dest_org = $"($env.BASE)/nushell"
if $ssha { if $ssha {
let $r = git git_clone nuscripts "git@git.ourworld.tf:despiegk/nuscripts.git" let $r = git git_clone nuscripts "git@git.ourworld.tf:despiegk/nuscripts.git" --reset=$reset --pull=$pull
rm -f $dest rm -f $dest
ln -s $r $dest ln -s $r $dest
return $r return $r
@ -41,13 +55,15 @@ export def clone_nuscripts [ --reset=false , --pull=false ] string {
} }
export def install_v [ --reset=false , --pull=false ] string { export def install_v [ --reset=false , --pull=false ] string {
let $r = git git_clone v "https://github.com/vlang/v" let $vpath = git git_clone v "https://github.com/vlang/v"
runonce run 'install_v' { runonce run 'install_v' {
cd $r cd $vpath
print "will compile V, can take a long while." print "will compile V, can take a long while."
^make ^make
} --reset $reset } --reset $reset
return $r rm -f $"($env.BASE)/bin/v"
ln -s $"($vpath)/v" $"($env.BASE)/bin/v"
return $vpath
} }
def url_mycelium [] string { def url_mycelium [] string {
@ -105,9 +121,11 @@ def url_hero [] string {
export def install_hero [] { export def install_hero [] {
let $name = "hero" let $name = "hero"
let $destpath = $"($env.BASE)/bin/hero" runonce run $'install_($name)' {
let $url = url_hero let $destpath = $"($env.BASE)/bin/hero"
print $url let $url = url_hero
download download_do $destpath $"($url)" --minsize 4 print $url
chmod +x $destpath download download_do $destpath $"($url)" --minsize 4
chmod +x $destpath
}
} }

View File

@ -7,8 +7,7 @@ export def "run" [
--reset: bool = false --reset: bool = false
#means we redo the command #means we redo the command
] { ] {
let $state_dir = $"($env.BASE)/done"
let $state_dir = $"($env.BASE/done)"
mkdir $state_dir mkdir $state_dir
let $state_file = $"($state_dir)/nu_done_($name)" let $state_file = $"($state_dir)/nu_done_($name)"
if ($reset or (not ($state_file | path exists ) ) ) { if ($reset or (not ($state_file | path exists ) ) ) {