colorchanges and addet file oldness check
This commit is contained in:
parent
00003f4cf3
commit
873bebd7e3
1 changed files with 20 additions and 6 deletions
18
distros.sh
18
distros.sh
|
@ -100,7 +100,7 @@ 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
|
||||
|
@ -183,12 +183,26 @@ 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
|
||||
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
|
||||
}
|
||||
|
||||
_setup() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue