mirror of https://git.jolheiser.com/dotnix.git
fix: respect owner flag in clone command
Signed-off-by: jolheiser <john.olheiser@gmail.com>teamcity
parent
68b207f960
commit
7eea1dda6a
|
@ -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] {
|
||||
|
|
Loading…
Reference in New Issue