larbs

Luke's Auto-Rice Bootstrapping Scripts: Auto-Setup & Configure Arch Linux
Log | Files | Refs | README | LICENSE

commit ea14797d142613956cd70ae424efcc13918ee3ef
parent 6d5389c7d819070bd12bd4846eaa56ecadcb6de8
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sat, 18 May 2019 16:47:15 -0400

branch fix and added to vl

Diffstat:
Marchi3/larbs.sh | 2+-
Mvoiddwm/vlarbs.sh | 9++++++---
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/archi3/larbs.sh b/archi3/larbs.sh @@ -122,7 +122,7 @@ installationloop() { \ putgitrepo() { # Downlods a gitrepo $1 and places the files in $2 only overwriting conflicts dialog --infobox "Downloading and installing config files..." 4 60 - [ -z "$repobranch" ] && branch="master" || branch="$repobranch" + [ -z "$3" ] && branch="master" || branch="$repobranch" dir=$(mktemp -d) [ ! -d "$2" ] && mkdir -p "$2" && chown -R "$name:wheel" "$2" chown -R "$name:wheel" "$dir" diff --git a/voiddwm/vlarbs.sh b/voiddwm/vlarbs.sh @@ -6,8 +6,9 @@ ### OPTIONS AND VARIABLES ### while getopts ":r:p:h" o; do case "${o}" in - h) printf "Optional arguments for custom use:\\n -r: Dotfiles repository (local file or url)\\n -p: Dependencies and programs csv (local file or url)\\n -h: Show this message\\n" && exit ;; + h) printf "Optional arguments for custom use:\\n -r: Dotfiles repository (local file or url)\\n -b: Dotfiles branch (master is assumed otherwise)\\n -p: Dependencies and programs csv (local file or url)\\n -h: Show this message\\n" && exit ;; r) dotfilesrepo=${OPTARG} && git ls-remote "$dotfilesrepo" || exit ;; + b) repobranch=${OPTARG} ;; p) progsfile=${OPTARG} ;; *) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;; esac done @@ -15,6 +16,7 @@ esac done # DEFAULTS: [ -z "$dotfilesrepo" ] && dotfilesrepo="https://github.com/lukesmithxyz/voidrice.git" [ -z "$progsfile" ] && progsfile="https://raw.githubusercontent.com/LukeSmithxyz/LARBS/master/progs.csv" +[ -z "$repobranch" ] && repobranch="master" ### FUNCTIONS ### @@ -90,11 +92,12 @@ installationloop() { \ done < /tmp/progs.csv ;} putgitrepo() { # Downlods a gitrepo $1 and places the files in $2 only overwriting conflicts + [ -z "$3" ] && branch="master" || branch="$repobranch" dialog --infobox "Downloading and installing config files..." 4 60 dir=$(mktemp -d) [ ! -d "$2" ] && mkdir -p "$2" && chown -R "$name:wheel" "$2" chown -R "$name:wheel" "$dir" - sudo -u "$name" git clone --depth 1 "$1" "$dir/gitrepo" >/dev/null 2>&1 && + sudo -u "$name" git clone -b "$branch" --depth 1 "$1" "$dir/gitrepo" >/dev/null 2>&1 && sudo -u "$name" cp -rfT "$dir/gitrepo" "$2" } @@ -147,7 +150,7 @@ xbps-install -y curl base-devel git >/dev/null 2>&1 installationloop # Install the dotfiles in the user's home directory -putgitrepo "$dotfilesrepo" "/home/$name" +putgitrepo "$dotfilesrepo" "/home/$name" "$repobranch" rm -f "/home/$name/README.md" "/home/$name/LICENSE" # Install vim `plugged` plugins.