This commit is contained in:
2024-11-09 19:15:29 -05:00
parent 6d6e63ea0d
commit 23e234eac0
13 changed files with 460 additions and 9 deletions
+39
View File
@@ -0,0 +1,39 @@
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}
}