diff options
Diffstat (limited to 'haur')
-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 |