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}-$1:${NC}${YELLOW} $2 ${NC}"
|
||||
echo "${BOLD}${BRIGHT_RED}${PACKAGE:-PKG}-$1:${NC}${BRIGHT_YELLOW} $2 ${NC}"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
echo_info() {
|
||||
echo "${BOLD}${BLUE}INFO:${NC}${BRIGHT_BLUE} $1 ${NC}"
|
||||
echo "${BOLD}${BLUE}INFO:${NC}${BRIGHT_BLUE} $1${NC}"
|
||||
}
|
||||
|
||||
echo_warning() {
|
||||
echo "${BOLD}${YELLOW}WARNING:${NC}${BRIGHT_YELLOW} $1 ${NC}"
|
||||
echo "${BOLD}${YELLOW}WARNING:${NC}${BRIGHT_YELLOW} $1${NC}"
|
||||
}
|
||||
|
||||
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 >─────────────────────────────────────────
|
||||
|
@ -183,9 +183,23 @@ check_env() {
|
|||
fi
|
||||
|
||||
pikaCheckFile="$HOME/.cache/pika_script_detection"
|
||||
checkFileAge() {
|
||||
local file="$1"
|
||||
[[ ! -e "$file" ]] && return 2 # File doesn't exist
|
||||
|
||||
if [ -e "$pikaCheckFile" ]; then
|
||||
PIKA_INIT=true
|
||||
if [[ $(find "$file" -mtime +7 -print) ]]; then
|
||||
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
|
||||
unset PIKA_INIT
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue