aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYash Karandikar2020-03-06 17:05:04 -0600
committerYash Karandikar2020-03-06 17:05:04 -0600
commiteaf2db92ea3e2bb00939305c6d59d5d43239e675 (patch)
treed63660bb4482f6b615282fb6c1574ae6b3b3c673
parentb477e654c35e0114a0b1b4199df87e1138b6a23b (diff)
downloadaur-eaf2db92ea3e2bb00939305c6d59d5d43239e675.tar.gz
Use new COnfiguration file
-rwxr-xr-xhaur46
1 files changed, 31 insertions, 15 deletions
diff --git a/haur b/haur
index 95636cd979a8..49602d4073b1 100755
--- a/haur
+++ b/haur
@@ -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