From e52c152b4f1830c659e59d79788f32727a360655 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 11 Jun 2020 21:31:59 +0100 Subject: Install GitHub software from GitHub repositories --- gohan.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gohan.sh') diff --git a/gohan.sh b/gohan.sh index 409ca93..388fc72 100644 --- a/gohan.sh +++ b/gohan.sh @@ -102,6 +102,23 @@ install_packages() { done < /tmp/packages.csv } +install_github_repositories() { + [ ! -d "/home/$name/.local/src" ] && mkdir -p "/home/$name/.local/src" && chown -R "$name":"$name" /home/"$name/.local" + install_from_github git@github.com:davidtsadler/st.git + install_from_github git@github.com:davidtsadler/dwm.git + install_from_github git@github.com:davidtsadler/dmenu.git +} + +install_from_github() { + progname="$(basename "$1" .git)" + repodir="/home/$name/.local/src" + dir="$repodir/$progname" + dialog --title "GOHAN Installation" --infobox "Installing \`$progname\` via \`git\` and \`make\`." 5 70 + sudo -u "$name" git clone --depth 1 "$1" "$dir" >/dev/null 2>&1 + cd "$dir" || exit + sudo -u "$name" make clean install >/dev/null 2>&1 +} + ### THE ACTUAL SCRIPT ### install_package dialog || error "Are you sure you're running this as the root user and have an internet connection?" @@ -121,4 +138,6 @@ save_github_ssh_keys || error "Error saving the GitHub SSH keys." install_packages +install_github_repositories + clear -- cgit v1.2.3-13-gbd6f