aboutsummaryrefslogtreecommitdiffstats
path: root/terminaldweller.com/cgit/bootstrap/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'terminaldweller.com/cgit/bootstrap/bootstrap.sh')
-rwxr-xr-xterminaldweller.com/cgit/bootstrap/bootstrap.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/terminaldweller.com/cgit/bootstrap/bootstrap.sh b/terminaldweller.com/cgit/bootstrap/bootstrap.sh
new file mode 100755
index 0000000..a943ffb
--- /dev/null
+++ b/terminaldweller.com/cgit/bootstrap/bootstrap.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+set -e
+
+GIT_REPO_DIR=/etc/gitrepos
+ORIGIN_HTTPS=https://github.com/terminaldweller
+ORIGIN_SSH=git@github.com:terminaldweller
+REPOS="cgrep \
+ mutator \
+ delf \
+ dwasm \
+ colo \
+ blog \
+ devourer \
+ hived \
+ mdrtl \
+ simplex \
+ scripts \
+ vagrantboxes \
+ dockerimages \
+ st \
+ dmenu \
+ tabbed \
+ dwm \
+ w3m \
+ leetcode \
+ irssi-scripts \
+ jupyter-notebook-docker-compose \
+ seer \
+ devi-githooks \
+ kaminokumo \
+ wikis \
+ grpc \
+ faultreiber \
+ luatablegen \
+ cfe-extra"
+
+bootstrap() {
+ for REPO in ${REPOS}; do
+ (cd "${GIT_REPO_DIR}" && git clone --bare "${ORIGIN_HTTPS}/${REPO}")
+ done
+}
+
+update_repos() {
+ for REPO in ${REPOS}; do
+ (cd "${GIT_REPO_DIR}/${REPO}" && git fetch)
+ done
+}
+
+on_startup() {
+ dir_list=$(ls -A == "$1")
+ if [ -z "$dir_list" ]; then
+ bootstrap
+ else
+ update_repos
+ fi
+}
+
+if [ "$1" = "--startup" ]; then
+ on_startup "$@"
+elif [ "$1" = "--update" ]; then
+ update_repos
+elif [ "$1" = "--bootstrap" ]; then
+ bootstrap
+fi