From 8ee3f84f739d686169f3ac196b9d8852d431f8a5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 3 Aug 2018 01:46:07 -0400 Subject: [PATCH] both gitrepo and progs file can be local or url --- larbs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/larbs.sh b/larbs.sh index 70a6fa0..afa1ac4 100755 --- a/larbs.sh +++ b/larbs.sh @@ -10,7 +10,7 @@ ### while getopts ":a:r:p:h" o; do case "${o}" in - h) echo -e "Optional arguments for custom use:\n-r: Dotfiles repository\n-p: Dependencies and programs csv (url)\n-a: AUR helper (must have pacman-like syntax, specifically, \`-S\` to install)\n-h: Show this message" && exit ;; + h) echo -e "Optional arguments for custom use:\n-r: Dotfiles repository (local file or url)\n-p: Dependencies and programs csv (local file or url)\n-a: AUR helper (must have pacman-like syntax, specifically, \`-S\` to install)\n-h: Show this message" && exit ;; r) dotfilesrepo=${OPTARG} && git ls-remote $dotfilesrepo || exit ;; p) progsfile=${OPTARG} ;; a) aurhelper=${OPTARG} ;; @@ -91,7 +91,7 @@ aurinstall() { \ } installationloop() { \ - curl -Ls "$progsfile" > /tmp/progs.csv + ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" > /tmp/progs.csv total=$(wc -l < /tmp/progs.csv) aurinstalled=$(pacman -Qm | awk '{print $1}') while IFS=, read -r tag program comment; do