tput is dead long live ansi

This commit is contained in:
Daylin Morgan 2022-09-02 16:05:05 -05:00
parent 8df4c02cea
commit 148080d470

View file

@ -1,12 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#colors #colors
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6) # remove tput just use ansi
YELLOW=$(tput setaf 3) MAGENTA="\033[35m"
RED=$(tput setaf 1) CYAN="\033[34m"
GREEN=$(tput setaf 2) YELLOW="\033[33m"
NORMAL=$(tput sgr0) RED="\033[31m"
GREEN="\033[32m"
NORMAL="\033[0m"
BIN_DIR=$HOME/bin BIN_DIR=$HOME/bin
YAMLDOC="$DOTFILES_DIR/info/tools.yml" YAMLDOC="$DOTFILES_DIR/info/tools.yml"
@ -17,6 +19,8 @@ INSTALL_NO=${RED}✗${NORMAL}
shopt -s nullglob shopt -s nullglob
BINARY_FILES=($HOME/bin/*) BINARY_FILES=($HOME/bin/*)
export EGET_BIN=$HOME/bin
alias eget="eget --system linux/amd64" alias eget="eget --system linux/amd64"
post_download_install() { post_download_install() {
@ -112,7 +116,7 @@ list() {
tool_cell=$(printf "%${tool_len}s" "") tool_cell=$(printf "%${tool_len}s" "")
user_cell=$(printf "%${user_len}s" "") user_cell=$(printf "%${user_len}s" "")
echo "${CYAN}CONFIGURED TOOLS${NORMAL}" echo -e "${CYAN}CONFIGURED TOOLS${NORMAL}"
printf "%${table_width}s\n" "" | tr ' ' = printf "%${table_width}s\n" "" | tr ' ' =
printf \ printf \
"${CYAN}tool${NORMAL}%s | \ "${CYAN}tool${NORMAL}%s | \
@ -225,7 +229,7 @@ if [ -z "$args" ]; then
else else
echo "Downloading binaries to ${GREEN}$BIN_DIR${NORMAL}" echo "Downloading binaries to ${GREEN}$BIN_DIR${NORMAL}"
deps_check deps_check
for tool in "$args"; do for tool in "${args[@]}"; do
download $tool download "$tool"
done done
fi fi