This commit is contained in:
despiegk 2024-01-13 13:37:40 +03:00
parent 8bfe62f3aa
commit eb1b267003
3 changed files with 23 additions and 7 deletions

1
nuscripts Symbolic link
View File

@ -0,0 +1 @@
/Users/despiegk1/code/git.ourworld.tf/despiegk/torrent/code/nuscripts

View File

@ -25,7 +25,7 @@ export def git_configure [] {
export def git_clone [ name: string url: string , --reset=false , --pull=false ] string { export def git_clone [ name: string url: string , --reset=false , --pull=false ] string {
print "git clone" print $"git clone '($url)'"
git_configure git_configure
@ -42,7 +42,7 @@ export def git_clone [ name: string url: string , --reset=false , --pull=false ]
git pull git pull
} }
} else { } else {
print $"git clone ($url)" print $"git clone execute"
cd $"($env.BASE)/code" cd $"($env.BASE)/code"
git clone --depth 1 --no-single-branch $url git clone --depth 1 --no-single-branch $url
} }
@ -54,8 +54,3 @@ def sshagent_loaded [ ] bool {
return ( (ssh-add -l | lines -s | length) > 0 ) return ( (ssh-add -l | lines -s | length) > 0 )
} }
# if not shagent_loaded() {
# print "could not find ssh-agent please load key in ssh-agent"
# exit 1
# }

View File

@ -1,6 +1,11 @@
use git.nu use git.nu
use download.nu use download.nu
def sshagent_loaded [ ] bool {
return ( (ssh-add -l | lines -s | length) > 0 )
}
def url_crystal [] { def url_crystal [] {
let $ssha = sshagent_loaded let $ssha = sshagent_loaded
if $ssha { if $ssha {
@ -16,6 +21,21 @@ export def clone_crystal [ --reset=false , --pull=false ] string {
return $r return $r
} }
export def clone_nuscripts [ --reset=false , --pull=false ] string {
let $ssha = sshagent_loaded
let $dest = $"($env.BASE)/nuscripts"
if $ssha {
let $r = git git_clone nuscripts "git@git.ourworld.tf:despiegk/nuscripts.git"
rm -f $dest
ln -s $r $dest
return $r
} else {
error make { msg: "load ssh-agent" }
}
}
def url_mycelium [] string { def url_mycelium [] string {
let $os = $nu.os-info.name let $os = $nu.os-info.name