Skip to content

Commit

Permalink
build(project): add fallback for color handling when tput is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Dec 3, 2024
1 parent 599e946 commit 5fefaba
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ TOOL_TPARSE_VERSION := v0.16.0
TOOL_TPARSE_PKG := github.com/mfridman/$(TOOL_TPARSE_NAME)@$(TOOL_TPARSE_VERSION)
TOOL_TPARSE_BIN := ${TOOLS_FOLDER}/$(TOOL_TPARSE_NAME)/$(TOOL_TPARSE_VERSION)/$(TOOL_TPARSE_NAME)

# Some colors
COLOR_GREEN = $(shell tput -Txterm setaf 2)
COLOR_YELLOW = $(shell tput -Txterm setaf 3)
COLOR_WHITE = $(shell tput -Txterm setaf 7)
COLOR_CYAN = $(shell tput -Txterm setaf 6)
COLOR_RED = $(shell tput -Txterm setaf 1)
COLOR_RESET = $(shell tput -Txterm sgr0)
# Some colors (if supported)
COLOR_GREEN = $(shell tput -Txterm setaf 2 2>/dev/null || echo "")
COLOR_YELLOW = $(shell tput -Txterm setaf 3 2>/dev/null || echo "")
COLOR_WHITE = $(shell tput -Txterm setaf 7 2>/dev/null || echo "")
COLOR_CYAN = $(shell tput -Txterm setaf 6 2>/dev/null || echo "")
COLOR_RED = $(shell tput -Txterm setaf 1 2>/dev/null || echo "")
COLOR_RESET = $(shell tput -Txterm sgr0 2>/dev/null || echo "")

# Blockchain constants
CHAIN := localnet
Expand Down

0 comments on commit 5fefaba

Please sign in to comment.