diff options
author | Yash Karandikar | 2020-03-06 17:05:04 -0600 |
---|---|---|
committer | Yash Karandikar | 2020-03-06 17:05:04 -0600 |
commit | eaf2db92ea3e2bb00939305c6d59d5d43239e675 (patch) | |
tree | d63660bb4482f6b615282fb6c1574ae6b3b3c673 | |
parent | b477e654c35e0114a0b1b4199df87e1138b6a23b (diff) | |
download | aur-eaf2db92ea3e2bb00939305c6d59d5d43239e675.tar.gz |
Use new COnfiguration file
-rwxr-xr-x | haur | 46 |
1 files changed, 31 insertions, 15 deletions
@@ -1,24 +1,37 @@ #!/usr/bin/env bash -if test -t 1; then +if [ -f $HOME/.config/haurrc ]; then + source $HOME/.config/haurrc +else + if [ -f /etc/haurrc ]; then + source /etc/haurrc + else + echo "fatal: No configuration file found" + exit 1 + fi +fi + +if [ ! $HAUR_NO_COLORS == "y" ]; then + if test -t 1; then # see if it supports colors... ncolors=$(tput colors 2>/dev/null) if test -n "$ncolors" && test $ncolors -ge 8; then - bold="$(tput bold 2>/dev/null)" - underline="$(tput smul 2>/dev/null)" - standout="$(tput smso 2>/dev/null)" - normal="$(tput sgr0 2>/dev/null)" - black="$(tput setaf 0 2>/dev/null)" - red="$(tput setaf 1 2>/dev/null)" - green="$(tput setaf 2 2>/dev/null)" - yellow="$(tput setaf 3 2>/dev/null)" - blue="$(tput setaf 4 2>/dev/null)" - magenta="$(tput setaf 5 2>/dev/null)" - cyan="$(tput setaf 6 2>/dev/null)" - white="$(tput setaf 7 2>/dev/null)" + bold="$(tput bold 2>/dev/null)" + underline="$(tput smul 2>/dev/null)" + standout="$(tput smso 2>/dev/null)" + normal="$(tput sgr0 2>/dev/null)" + black="$(tput setaf 0 2>/dev/null)" + red="$(tput setaf 1 2>/dev/null)" + green="$(tput setaf 2 2>/dev/null)" + yellow="$(tput setaf 3 2>/dev/null)" + blue="$(tput setaf 4 2>/dev/null)" + magenta="$(tput setaf 5 2>/dev/null)" + cyan="$(tput setaf 6 2>/dev/null)" + white="$(tput setaf 7 2>/dev/null)" fi + fi fi REMOVE=false @@ -41,8 +54,8 @@ shift $((OPTIND -1)) while getopts ":urch" opt; do case $opt in u ) - UPDATE=true - ;; + UPDATE=true + ;; r ) REMOVE=true ;; @@ -61,6 +74,9 @@ while getopts ":urch" opt; do done shift $((OPTIND -1)) +if [ $HAUR_ALWAYS_CLEAR_CACHE == "y" ]; then + CLEAR_CACHE=true +fi if [ $REMOVE == true ]; then for PACKAGE_NAME in "$@"; do |