colorchanges and addet file oldness check
This commit is contained in:
parent
00003f4cf3
commit
873bebd7e3
1 changed files with 20 additions and 6 deletions
26
distros.sh
26
distros.sh
|
@ -100,22 +100,22 @@ echo_pkg() {
|
||||||
echo "${BOLD}${BRIGHT_RED}${PACKAGE:-PKG}-dependencies:${BRIGHT_YELLOW} $2 ${NC}"
|
echo "${BOLD}${BRIGHT_RED}${PACKAGE:-PKG}-dependencies:${BRIGHT_YELLOW} $2 ${NC}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "${BOLD}${BRIGHT_RED}${PACKAGE:-PKG}-$1:${NC}${YELLOW} $2 ${NC}"
|
echo "${BOLD}${BRIGHT_RED}${PACKAGE:-PKG}-$1:${NC}${BRIGHT_YELLOW} $2 ${NC}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
echo_info() {
|
echo_info() {
|
||||||
echo "${BOLD}${BLUE}INFO:${NC}${BRIGHT_BLUE} $1 ${NC}"
|
echo "${BOLD}${BLUE}INFO:${NC}${BRIGHT_BLUE} $1${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo_warning() {
|
echo_warning() {
|
||||||
echo "${BOLD}${YELLOW}WARNING:${NC}${BRIGHT_YELLOW} $1 ${NC}"
|
echo "${BOLD}${YELLOW}WARNING:${NC}${BRIGHT_YELLOW} $1${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo_note() {
|
echo_note() {
|
||||||
echo "${BOLD}${GREEN}NOTE:${NC}${BRIGHT_GREEN} $1 ${NC}"
|
echo "${BOLD}${GREEN}NOTE:${NC}${BRIGHT_GREEN} $1${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
# ─< Check if the given command exists silently >─────────────────────────────────────────
|
||||||
|
@ -183,9 +183,23 @@ check_env() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pikaCheckFile="$HOME/.cache/pika_script_detection"
|
pikaCheckFile="$HOME/.cache/pika_script_detection"
|
||||||
|
checkFileAge() {
|
||||||
|
local file="$1"
|
||||||
|
[[ ! -e "$file" ]] && return 2 # File doesn't exist
|
||||||
|
|
||||||
if [ -e "$pikaCheckFile" ]; then
|
if [[ $(find "$file" -mtime +7 -print) ]]; then
|
||||||
PIKA_INIT=true
|
return 69 # File is older than 1 week
|
||||||
|
else
|
||||||
|
return 0 # File is within 1 week
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -f "$pikaCheckFile" ]; then
|
||||||
|
if checkFileAge $pikaCheckFile; then
|
||||||
|
PIKA_INIT=true
|
||||||
|
else
|
||||||
|
unset PIKA_INIT
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
unset PIKA_INIT
|
unset PIKA_INIT
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue