summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-10-13 21:47:32 -0400
committerRaghuram Subramani <raghus2247@gmail.com>2025-10-13 21:47:32 -0400
commitf7f203fe9f2e03396824e30e8da30cbbe55b71d7 (patch)
tree1110639c492f2d54fc5eae5070f3d1c90fdec374
parent287ba0a83e7c99ec48ef41279410b5937c8c2e65 (diff)
add clone-all-github
-rwxr-xr-xbash2
-rwxr-xr-xclone2
-rwxr-xr-xclone-all-github24
-rwxr-xr-xdesc2
-rwxr-xr-xhelp2
-rwxr-xr-xinit2
-rwxr-xr-xls2
-rwxr-xr-xrm2
8 files changed, 31 insertions, 7 deletions
diff --git a/bash b/bash
index 94d1f2f..c89fd51 100755
--- a/bash
+++ b/bash
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env bash
bash
diff --git a/clone b/clone
index f2bf406..673f0d7 100755
--- a/clone
+++ b/clone
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
if [ $# -ne 1 ]; then
echo "usage: clone <name>"
diff --git a/clone-all-github b/clone-all-github
new file mode 100755
index 0000000..ebdeb78
--- /dev/null
+++ b/clone-all-github
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+USER=compromyse
+REPOS=$(curl https://api.github.com/users/$USER/repos 2>/dev/null | jq -r '.[0].name')
+
+for rawname in $REPOS; do
+ repo=$rawname.git
+
+ if [ ! -d $HOME/$repo ]; then
+
+ git clone --bare https://github.com/$USER/$repo $HOME/$repo
+
+ pushd $HOME/$repo > /dev/null
+
+ for remote in $(git remote show); do
+ git remote remove $remote
+ git remote add github git@github.com:$USER/$repo
+ git fetch github
+ done
+
+ popd > /dev/null
+
+ fi
+done
diff --git a/desc b/desc
index 2d348ab..ed99ccc 100755
--- a/desc
+++ b/desc
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
if [ $# -ne 1 ]; then
echo "usage: desc <name>"
diff --git a/help b/help
index f579f9b..3665137 100755
--- a/help
+++ b/help
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
echo """Welcome to git-shell on $(uname -n)!
diff --git a/init b/init
index 08e7897..34e48a5 100755
--- a/init
+++ b/init
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
if [ $# -ne 1 ]; then
echo "usage: init <name>"
diff --git a/ls b/ls
index c7da128..cf37390 100755
--- a/ls
+++ b/ls
@@ -1,3 +1,3 @@
-#!/bin/sh
+#!/usr/bin/env bash
find "$HOME" -maxdepth 1 -type d -name '*\.git' -printf "%f\n"
diff --git a/rm b/rm
index 1402bae..287f8ba 100755
--- a/rm
+++ b/rm
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
if [ $# -ne 1 ]; then
echo "usage: rm <name>"