diff --git a/apps/nogui/nushell/jolheiser.nu b/apps/nogui/nushell/jolheiser.nu index 104803b..e6f3bfa 100644 --- a/apps/nogui/nushell/jolheiser.nu +++ b/apps/nogui/nushell/jolheiser.nu @@ -33,7 +33,6 @@ def clone [ --forge (-f) = "github": string@"forge types" # Forge type (github, gitea, jojodev, codeberg) --owner (-o): string # Owner (default: current dir name) ] { - let owner = ($env.PWD | path basename) mut id = 'gh' if $forge == 'gitea' { $id = 'gt' @@ -42,12 +41,18 @@ def clone [ } else if $forge == 'codeberg' { $id = 'cb' } + mut namespace = ($env.PWD | path basename) + if $owner != '' { + $namespace = $owner + } let origin = $'ssh:($id):jolheiser/($repo).git' - let upstream = $'($id):($owner)/($repo).git' + let upstream = $'($id):($namespace)/($repo).git' ^git clone $origin cd $repo - ^git remote add upstream $upstream - ^git fetch upstream + if $namespace != 'jolheiser' { + ^git remote add upstream $upstream + ^git fetch upstream + } } def fg [args ...string] {