summaryrefslogtreecommitdiffstats
path: root/.bin/upgit
diff options
context:
space:
mode:
Diffstat (limited to '.bin/upgit')
-rwxr-xr-x.bin/upgit23
1 files changed, 23 insertions, 0 deletions
diff --git a/.bin/upgit b/.bin/upgit
new file mode 100755
index 0000000..ab44207
--- /dev/null
+++ b/.bin/upgit
@@ -0,0 +1,23 @@
+#!/usr/bin/env zsh
+
+# Make sure to always start in $HOME
+cd $HOME;
+
+# Always remove the existing file so we let git compare
+[ -e ~/.setup/gitlist ] && rm ~/.setup/gitlist
+touch ~/.setup/gitlist
+
+# Iterate through all code folders and produce a CSV of
+# folder,remote=URL,remote2=URL
+# and so on
+for p in $(fd -H -t d '.git$' code); do
+ cd $p/..
+ echo -n ${p%.git} >> ~/.setup/gitlist
+ for r in $(git remote); do
+ # get remote URL
+ echo -n ,$r=$(git config --get remote.$r.url) >> ~/.setup/gitlist
+ done
+ echo "" >> ~/.setup/gitlist
+ cd $HOME
+done
+