commit 514353eed14f789c679c060c8433a8e83cf0547b
parent 4fc143daa0939fc19af4b6e03cdf296ccb04982e
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Sat, 19 Jan 2019 14:50:12 -0500
Add bootstrapping script.
Diffstat:
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -16,5 +16,7 @@
!.config/rofi/*
!.config/rofi-pass
!.config/rofi-pass/*
+!.scripts
+!.scripts/*
!.profile
!.zprofile
\ No newline at end of file
diff --git a/.scripts/bigmod b/.scripts/bigmod
@@ -0,0 +1,21 @@
+# Inspired by LARBS (https://larbs.xyz)
+
+[ -z "$dotfilesrepo" ] && dotfilesrepo="ssh://gitea@git.shimmy1996.com:4869/shimmy1996/dotfiles.git"
+
+[ -z "$name" ] && name=shimmy
+
+putgitrepo() { # Downlods a gitrepo $1 and places the files in $2 only overwriting conflicts
+ dialog --infobox "Downloading and installing config files..." 4 60
+ dir=$(mktemp -d)
+ chown -R "$name":wheel "$dir"
+ sudo -u "$name" git clone --depth 1 "$1" "$dir/gitrepo" >/dev/null 2>&1 &&
+ sudo -u "$name" mkdir -p "$2" &&
+ sudo -u "$name" cp -rfT "$dir"/gitrepo "$2"
+ sudo -u "$name" rm -f "$2/README.org"
+ sudo -u "$name" rm -f "$2/LICENCE"
+}
+
+# Install the dotfiles in the user's home directory
+putgitrepo "$dotfilesrepo" "/home/$name" || error "Programs have installed, but dotfiles failed to deploy."
+
+dialog --infobox "BIGMOD deployed." 3 20