Fix timestamp not reflecting start of task

This commit is contained in:
kayos@tcp.direct 2023-01-17 00:43:16 -08:00
parent 814a9af473
commit 440625a742
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
2 changed files with 12 additions and 6 deletions

@ -14,6 +14,7 @@ if ! [[ ":$PATH:" == *":$_target:"* ]]; then
fi fi
cd .. cd ..
if ! ls -lah "${_target}/clone-all" >/dev/null; then if ! ls -lah "${_target}/clone-all" >/dev/null; then
echo "installation failed somehow" echo "installation failed somehow, clone-all should have existed at ${_target}/clone-all"
exit
fi fi
echo "clone-all installed to: ${_target}/clone-all" echo "clone-all installed to: ${_target}/clone-all"

@ -9,6 +9,8 @@ LNOPE="\e[31mError\e[0m"
FATAL="\e[1;31m" FATAL="\e[1;31m"
RESET="\e[0m" RESET="\e[0m"
LAST="" LAST=""
LAST_TIME=""
function _t() { function _t() {
echo -e "\e[90m[$(date -u +'%H:%M:%S')]${RESET}" echo -e "\e[90m[$(date -u +'%H:%M:%S')]${RESET}"
} }
@ -17,21 +19,24 @@ function cln() {
echo "$*" | sed -z 's|\n| |g' echo "$*" | sed -z 's|\n| |g'
} }
function log() { function log() {
LAST_TIME="$(_t)"
LAST="${*}..." LAST="${*}..."
echo -ne "$(cln "$(_t) ${LFOOB} ${LAST}")" echo -ne "$(cln "${LAST_TIME} ${LFOOB} ${LAST}")"
} }
function log0() { function log0() {
echo -ne "\r$(cln "$(_t) ${LPLUS} ${LAST}${LWOOT}${RESET}")\n" echo -ne "\r$(cln "${LAST_TIME} ${LPLUS} ${LAST}${LWOOT}${RESET}")\n"
LAST="" LAST=""
LAST_TIME=""
} }
function log1() { function log1() {
echo -ne "\r$(cln "$(_t) ${LFAIL} ${LAST}${LNOPE}${RESET}")\n" echo -ne "\r$(cln "${LAST_TIME} ${LFAIL} ${LAST}${LNOPE}${RESET}")\n"
LAST="" LAST=""
LAST_TIME=""
} }
function log2() { function log2() {
NEW="${LAST//Cloning/Updating}${REDIR}${RESET}" NEW="${LAST//Cloning/Updating}${REDIR}${RESET}"
echo -ne "\r$(cln "$(_t) ${LFOOB} ${NEW}")" echo -ne "\r$(cln "${LAST_TIME} ${LFOOB} ${NEW}")"
LAST=$NEW LAST="$NEW"
} }
function logln() { function logln() {
echo -e "$(_t) ${LFOOB} ${*}" echo -e "$(_t) ${LFOOB} ${*}"