Files
jj-command-line/bashUtils/index.sh
T
2024-11-09 19:15:29 -05:00

40 lines
835 B
Bash

export UNAME="$(uname)"
setopt aliases complete_aliases
unsetopt multios
function jjOsPackageMamanger {
SUPPORTED_PACKAGE_MANAGERS=("apt-get -y" "brew" "yum -y")
for i in "${SUPPORTED_PACKAGE_MANAGERS[@]}"; do
PACKAGE_MANAGER=($i)
if test "$( which "$PACKAGE_MANAGER" )"; then
echo "$(which ${PACKAGE_MANAGER[0]}) ${PACKAGE_MANAGER[1]} $1"
return 0
fi
done
return 1
}
function jjIsFileOlderDuration {
if [[ ! $(find "$1" -newermt "$2 ago") ]]; then
return 0
fi
return 1
}
function jjIsFileNewerFile {
if [[ "$1" -nt "$2" ]]; then
echo "File ($(date -r $1)) '$1' is newer than"
echo "file ($(date -r $2)) '$2'!"
return 0
fi
return 1
}
function jjCliLog {
"$JJ_SOURCE_DIR/helpers/jjLogger.ts" $1 ${@:2}
}