diff --git a/nuscripts b/nuscripts new file mode 120000 index 0000000..c0437ab --- /dev/null +++ b/nuscripts @@ -0,0 +1 @@ +/Users/despiegk1/code/git.ourworld.tf/despiegk/torrent/code/nuscripts \ No newline at end of file diff --git a/nushell/tools/git.nu b/nushell/tools/git.nu index 6dad12e..142dc89 100644 --- a/nushell/tools/git.nu +++ b/nushell/tools/git.nu @@ -25,7 +25,7 @@ export def git_configure [] { export def git_clone [ name: string url: string , --reset=false , --pull=false ] string { - print "git clone" + print $"git clone '($url)'" git_configure @@ -42,7 +42,7 @@ export def git_clone [ name: string url: string , --reset=false , --pull=false ] git pull } } else { - print $"git clone ($url)" + print $"git clone execute" cd $"($env.BASE)/code" git clone --depth 1 --no-single-branch $url } @@ -54,8 +54,3 @@ def sshagent_loaded [ ] bool { 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 -# } - diff --git a/nushell/tools/herotools.nu b/nushell/tools/herotools.nu index a8aea23..8f9d489 100644 --- a/nushell/tools/herotools.nu +++ b/nushell/tools/herotools.nu @@ -1,6 +1,11 @@ use git.nu use download.nu +def sshagent_loaded [ ] bool { + return ( (ssh-add -l | lines -s | length) > 0 ) +} + + def url_crystal [] { let $ssha = sshagent_loaded if $ssha { @@ -16,6 +21,21 @@ export def clone_crystal [ --reset=false , --pull=false ] string { 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 { let $os = $nu.os-info.name