parent
8df1405bac
commit
8ec5210d70
|
@ -25,6 +25,32 @@ def nixdev [
|
||||||
^nu -c $cmd
|
^nu -c $cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def "forge types" [] {
|
||||||
|
["github", "gitea", "jojodev", "codeberg"]
|
||||||
|
}
|
||||||
|
|
||||||
|
def clone [
|
||||||
|
repo: string # Repo name
|
||||||
|
--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'
|
||||||
|
} else if $forge == 'jojodev' {
|
||||||
|
$id = 'jj'
|
||||||
|
} else if $forge == 'codeberg' {
|
||||||
|
$id = 'cb'
|
||||||
|
}
|
||||||
|
let origin = $'ssh:($id):jolheiser/($repo).git'
|
||||||
|
let upstream = $'($id):($owner)/($repo).git'
|
||||||
|
^git clone $origin
|
||||||
|
cd $repo
|
||||||
|
^git remote add upstream $upstream
|
||||||
|
^git fetch upstream
|
||||||
|
}
|
||||||
|
|
||||||
## Other ##
|
## Other ##
|
||||||
$env.EDITOR = hx
|
$env.EDITOR = hx
|
||||||
$env.config = ($env.config | upsert "shell_integration" ("WEZTERM_PANE" not-in $env and "SSH_CLIENT" not-in $env))
|
$env.config = ($env.config | upsert "shell_integration" ("WEZTERM_PANE" not-in $env and "SSH_CLIENT" not-in $env))
|
||||||
|
|
Reference in New Issue