tui fixes

This commit is contained in:
kayos@tcp.direct 2022-11-14 20:42:40 -08:00
parent 58dce564b8
commit f2d4cab3df
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
5 changed files with 26 additions and 20 deletions

View File

@ -4,9 +4,9 @@ set -e
_target="$HOME/.local/bin"
mkdir -vp "$_target"
rm -v "${_target}/clone-all"
touch "${_target}/clone-all"
echo '#!/usr/bin/env bash' >> "${_target}/clone-all"
cd src
cat ./*.sh >>"${_target}/clone-all"
cat ./*.sh | grep -v 'usr/bin/env' >>"${_target}/clone-all"
chmod +x "${_target}/clone-all"
if ! [[ ":$PATH:" == *":$_target:"* ]]; then
echo "Your PATH is missing '$_target', consider adding it."

View File

@ -1 +0,0 @@
#!/usr/bin/env bash

View File

@ -29,7 +29,7 @@ function log1() {
LAST=""
}
function log2() {
NEW="${LAST//Cloning/Updating}${REDIR}${*}... ${RESET}"
NEW="${LAST//Cloning/Updating}${REDIR}${RESET}"
echo -ne "\r$(cln "$(_t) ${LFOOB} ${NEW}")"
LAST=$NEW
}
@ -47,16 +47,3 @@ function fatal() {
err "${FATAL}[FATAL]${RESET}: $*"
exit 1
}
function testLogger() {
log "trying to yeet"
sleep 1
log0
log "trying to yort"
sleep 1
log1
log "trying to yeeeeeeeeeeet"
sleep 1
log2 "Slowing it down"
sleep 1
log0
}

View File

@ -5,6 +5,7 @@ function update() {
_TARGET="${_DESTINATION}/${_USERNAME}/$1"
#debug "$(mkdir -vp "$_TARGET")"
if ! cd "$_TARGET"; then
log1
err "failed to change directory to update $1"
return 1
fi
@ -19,10 +20,10 @@ function update() {
return 1
fi
# shellcheck disable=SC2076
if ! [[ "$_P" =~ "Already up to date." ]]; then
log0
if [[ "$_P" =~ "Already up to date." ]]; then
echo -e "Current"
return 0
fi
echo -e "Current"
log0
return 0
}

19
test/test_logger.sh Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
source ../src/1-logr.sh
function testLogger() {
log "trying to yeet"
sleep 1
log0
log "trying to yort"
sleep 1
log1
log "trying to yeeeeeeeeeeet"
sleep 1
log2 "Slowing it down"
sleep 1
log0
}
testLogger