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

View File

@ -4,3 +4,4 @@ use tools/runonce.nu
use tools/git.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 {
let $vpath = install_v
rm -f $"($env.BASE)/bin/v"
ln -s $"($vpath)/v" $"($env.BASE)/bin/v"
let $url = url_crystal
let $r = git git_clone crystallib $url
# ln -s $"($r)/"
return $r
let $crlibpath = git git_clone crystallib $url --reset=$reset --pull=$pull
let $weburl = url_webcomponents
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 {
@ -31,7 +45,7 @@ export def clone_nuscripts [ --reset=false , --pull=false ] string {
let $dest = $"($env.BASE)/nuscripts"
let $dest_org = $"($env.BASE)/nushell"
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
ln -s $r $dest
return $r
@ -41,13 +55,15 @@ export def clone_nuscripts [ --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' {
cd $r
cd $vpath
print "will compile V, can take a long while."
^make
} --reset $reset
return $r
rm -f $"($env.BASE)/bin/v"
ln -s $"($vpath)/v" $"($env.BASE)/bin/v"
return $vpath
}
def url_mycelium [] string {
@ -105,9 +121,11 @@ def url_hero [] string {
export def install_hero [] {
let $name = "hero"
let $destpath = $"($env.BASE)/bin/hero"
let $url = url_hero
print $url
download download_do $destpath $"($url)" --minsize 4
chmod +x $destpath
runonce run $'install_($name)' {
let $destpath = $"($env.BASE)/bin/hero"
let $url = url_hero
print $url
download download_do $destpath $"($url)" --minsize 4
chmod +x $destpath
}
}

View File

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