summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-02-10 12:15:43 -0600
committerzachir <zachir@librem.one>2023-02-10 12:15:43 -0600
commit3b5f272c0bac39d5e0939c231ee6fab7a8c975f0 (patch)
treea8bd5232643f1e99e57368bd227e848a5fb782a5
parent3368c96a056c4c7776de9f5bc6d8ed84bf3f9e94 (diff)
add user bin directory to zirless, fix help message
-rw-r--r--zirless.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/zirless.sh b/zirless.sh
index 3f94d22..94292b8 100644
--- a/zirless.sh
+++ b/zirless.sh
@@ -6,20 +6,25 @@
### OPTIONS AND VARIABLES ###
-while getopts ":a:r:b:p:s: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 -a: AUR helper (must have pacman-like syntax)\\n -h: Show this message\\n" && exit 1 ;;
+while getopts ":a:b:B:r:R:p:s:h" o; do case "${o}" in
+ h) printf "Optional arguments for custom use:\\n -r: Dotfiles repository (local file or url)\\n -R: Dotfiles repository branch\\n -b: User bin repository (local file or url)\\n -B: User bin repository branch\\n -p: Dependencies and programs csv (local file or url)\\n -s: Root command (sudo implied)\\n -a: AUR helper (must have pacman-like syntax)\\n -h: Show this message\\n" && exit 1 ;;
r) dotfilesrepo=${OPTARG} && git ls-remote "$dotfilesrepo" || exit 1 ;;
- b) repobranch=${OPTARG} ;;
+ R) repobranch=${OPTARG} ;;
p) progsfile=${OPTARG} ;;
a) aurhelper=${OPTARG} ;;
+ b) binrepo=${OPTARG} && git ls-remote "$binrepo" || exit 1 ;;
+ B) binrepobranch=${OPTARG} ;;
s) rootcmd=${OPTARG} ;;
+
*) printf "Invalid option: -%s\\n" "$OPTARG" && exit 1 ;;
esac done
-[ -z "$dotfilesrepo" ] && dotfilesrepo="https://gitlab.com/zachir/dotfiles.git"
+[ -z "$dotfilesrepo" ] && dotfilesrepo="https://git.zachir.xyz/dotfiles.git"
+[ -z "$repobranch" ] && repobranch="master"
[ -z "$progsfile" ] && progsfile="progs.csv"
[ -z "$aurhelper" ] && aurhelper="yay"
-[ -z "$repobranch" ] && repobranch="master"
+[ -z "$binrepo" ] && binrepo="https://git.zachir.xyz/bin.git"
+[ -z "$binrepobranch" ] && binrepobranch="master"
[ -z "$rootcmd" ] && rootcmd="sudo"
### FUNCTIONS ###
@@ -293,6 +298,7 @@ yes | $rootcmd -u "$name" $aurhelper -S libxft-bgra-git >/dev/null 2>&1
# Install the dotfiles in the user's home directory
putgitrepo "$dotfilesrepo" "/home/$name/.config" "$repobranch"
+putgitrepo "$binrepo" "/home/$name/.local/bin" "$binrepobranch"
rm -f "/home/$name/README.md" "/home/$name/LICENSE" "/home/$name/FUNDING.yml"
# Create default urls file if none exists.
[ ! -f "/home/$name/.config/newsboat/urls" ] && echo "http://lukesmith.xyz/rss.xml