Home

dotnix @main - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
tree log patch
feat: clone Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmVhMP8ACgkQuFOtpdp7 v3qfBxAAt3VDog+39oxjO2iBGrhfIQLt99GPq9okcT4xq717JYF7eNowKou9hTak tyxPgrSe2TrUSaTkNKRf27Kx1JonDbJhWsi0iPAxb6BoCrZooN9DLxEpVanDGaOk 50U3x57+N5Dx1DeZdduTBv0D+e5N3QwLGKPwq0Jbqi0YRkqP+Ak4zRVvNTWO3khX AIkFAHa8IjatCoJMBMeEMIVBkDsGTMJmPupBtBCI92/9/NFZjB3wFcypqkPrvSOc gtU1aPcCeoiG7s5ZCTAZi0KD6UDN7xN1nRz4XEyL0Z0gsxyMuEsvFitiurPakK8k e9IUuIkFxcY+2RyldY/8zAqKU2A3xBCCJ/P+dYSnco0+vCnp52Dmh+XOZCUnrNrK G/BQaW1exHx1KqUI3p8fser8Ih5C8uYgczSnRaZk+kZPkLAQRI/T5kNN/VkGy49v qpvWgonrDqWWxFLu2z24GwTXWufsG9AIylpGNcKUwF/zPhaa1vUsZL2DrzoTBZfq FSFdcTA65WGutB8mhp/BH1AqvVPnkiyRM4ZfqalW3KznvtW4YWkCU3r9eklIK+QH PnHfBoQJOmq8yAQCBkKNT/nsL2CCS2SKVGfD4iRsgiD1dUxeD5je8wHIgVqTlF/Z w+WyhXBT49RgW1muyneSGM+I5YuFkG7cDVOGXeaKiAilsXkqk4g= =ZAn0 -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
1 year ago
1 changed files, 26 additions(+), 0 deletions(-)
M apps/nogui/nushell/jolheiser.nu -> apps/nogui/nushell/jolheiser.nu
diff --git a/apps/nogui/nushell/jolheiser.nu b/apps/nogui/nushell/jolheiser.nu
index 6fbd8b3e77b1a07742e2145fb742a6cc4c2636c8..0d6e4bcaeaaa4c9be01d5c44e09863af274b11d4 100644
--- a/apps/nogui/nushell/jolheiser.nu
+++ b/apps/nogui/nushell/jolheiser.nu
@@ -25,6 +25,32 @@ 	let cmd = $"nix develop ($refresh) ($url) ($c)"
 	^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 ##
 $env.EDITOR = hx
 $env.config = ($env.config | upsert "shell_integration" ("WEZTERM_PANE" not-in $env and "SSH_CLIENT" not-in $env))