From 8eaa3ba56edaf89138549d0854e3a94c0dbad060 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 13 Oct 2022 11:09:53 +0200 Subject: [PATCH] lib/bash: remove unused Bash library files The color echo functions are provided by `lib/bash/home-manager.sh`. --- lib/bash/color-echo | 41 ---------------------------------- modules/lib-bash/color-echo.sh | 39 -------------------------------- 2 files changed, 80 deletions(-) delete mode 100644 lib/bash/color-echo delete mode 100644 modules/lib-bash/color-echo.sh diff --git a/lib/bash/color-echo b/lib/bash/color-echo deleted file mode 100644 index c16381807..000000000 --- a/lib/bash/color-echo +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -# The check for terminal output and color support is heavily inspired -# by https://unix.stackexchange.com/a/10065. -# -# Allow opt out by respecting the `NO_COLOR` environment variable. - -function setupColors() { - normalColor="" - errorColor="" - warnColor="" - noteColor="" - - # Enable colors for terminals, and allow opting out. - if [[ ! -v NO_COLOR && -t 1 ]]; then - # See if it supports colors. - local ncolors - ncolors=$(tput colors) - - if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then - normalColor="$(tput sgr0)" - errorColor="$(tput bold)$(tput setaf 1)" - warnColor="$(tput setaf 3)" - noteColor="$(tput bold)$(tput setaf 6)" - fi - fi -} - -setupColors - -function errorEcho() { - echo "${errorColor}$*${normalColor}" -} - -function warnEcho() { - echo "${warnColor}$*${normalColor}" -} - -function noteEcho() { - echo "${noteColor}$*${normalColor}" -} diff --git a/modules/lib-bash/color-echo.sh b/modules/lib-bash/color-echo.sh deleted file mode 100644 index ac36cedc6..000000000 --- a/modules/lib-bash/color-echo.sh +++ /dev/null @@ -1,39 +0,0 @@ -# The check for terminal output and color support is heavily inspired -# by https://unix.stackexchange.com/a/10065. -# -# Allow opt out by respecting the `NO_COLOR` environment variable. - -function setupColors() { - normalColor="" - errorColor="" - warnColor="" - noteColor="" - - # Enable colors for terminals, and allow opting out. - if [[ ! -v NO_COLOR && -t 1 ]]; then - # See if it supports colors. - local ncolors - ncolors=$(tput colors) - - if [[ -n "$ncolors" && "$ncolors" -ge 8 ]]; then - normalColor="$(tput sgr0)" - errorColor="$(tput bold)$(tput setaf 1)" - warnColor="$(tput setaf 3)" - noteColor="$(tput bold)$(tput setaf 6)" - fi - fi -} - -setupColors - -function errorEcho() { - echo "${errorColor}$*${normalColor}" -} - -function warnEcho() { - echo "${warnColor}$*${normalColor}" -} - -function noteEcho() { - echo "${noteColor}$*${normalColor}" -}