Refactor colored install log format - implement log functions and update all install scripts
Co-authored-by: andrejusk <7396847+andrejusk@users.noreply.github.com>
This commit is contained in:
@@ -10,5 +10,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
cat /etc/os-release
|
||||
else
|
||||
echo -e "${RED}Unknown OS: $OSTYPE${NC}"
|
||||
log_error "Unknown OS: $OSTYPE"
|
||||
fi
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
# skip if CODESPACES is set
|
||||
if [ -n "$CODESPACES" ]; then
|
||||
echo -e "${YELLOW}Running in a GitHub Codespace${NC}"
|
||||
log_warn "Running in a GitHub Codespace"
|
||||
export SKIP_SSH_CONFIG=1
|
||||
fi
|
||||
|
||||
@@ -29,5 +29,5 @@ if [ -z "$SKIP_SSH_CONFIG" ]; then
|
||||
|
||||
unset ssh_method ssh_target ssh_key ssh_pub
|
||||
else
|
||||
echo -e "${YELLOW}Skipping SSH configuration${NC}"
|
||||
log_warn "Skipping SSH configuration"
|
||||
fi
|
||||
|
||||
@@ -24,5 +24,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
fi
|
||||
brew --version
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -21,5 +21,5 @@ if command -v apt-get &> /dev/null; then
|
||||
|
||||
apt --version
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: apt-get not found${NC}"
|
||||
log_warn "Skipping: apt-get not found"
|
||||
fi
|
||||
|
||||
@@ -8,19 +8,19 @@
|
||||
|
||||
# skip if in WSL
|
||||
if [[ -n "$WSL_DISTRO_NAME" ]]; then
|
||||
echo -e "${YELLOW}Running in WSL${NC}"
|
||||
log_warn "Running in WSL"
|
||||
export SKIP_DOCKER_CONFIG=1
|
||||
fi
|
||||
|
||||
# skip if in CODESPACES
|
||||
if [[ -n "$CODESPACES" ]]; then
|
||||
echo -e "${YELLOW}Running in GitHub Codespaces${NC}"
|
||||
log_warn "Running in GitHub Codespaces"
|
||||
export SKIP_DOCKER_CONFIG=1
|
||||
fi
|
||||
|
||||
# skip on mac
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo -e "${YELLOW}Running on macOS${NC}"
|
||||
log_warn "Running on macOS"
|
||||
export SKIP_DOCKER_CONFIG=1
|
||||
fi
|
||||
|
||||
@@ -57,5 +57,5 @@ if [[ -z "$SKIP_DOCKER_CONFIG" ]]; then
|
||||
fi
|
||||
docker --version
|
||||
else
|
||||
echo -e "${YELLOW}Skipping Docker configuration${NC}"
|
||||
log_warn "Skipping Docker configuration"
|
||||
fi
|
||||
|
||||
@@ -9,7 +9,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
if ! brew list --cask iterm2 &>/dev/null; then
|
||||
brew install --cask iterm2
|
||||
fi
|
||||
echo -e "${GREEN}iTerm2 installed successfully!${NC}"
|
||||
log_pass "iTerm2 installed successfully!"
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -20,5 +20,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
|
||||
unset fonts_list
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -12,5 +12,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "Colour Contrast Analyser (CCA) is already installed."
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -12,5 +12,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "Rectangle is already installed."
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -12,5 +12,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "MeetingBar is already installed."
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -12,5 +12,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "BetterDisplay is already installed."
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -12,5 +12,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "dockutil is already installed."
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -12,5 +12,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "Arc Browser is already installed."
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -13,5 +13,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "AppCleaner is already installed."
|
||||
fi
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
# skip if in CODESPACES
|
||||
if [[ -n "$CODESPACES" ]]; then
|
||||
echo -e "${YELLOW}Running in GitHub Codespaces${NC}"
|
||||
log_warn "Running in GitHub Codespaces"
|
||||
export SKIP_CMATRIX_CONFIG=1
|
||||
fi
|
||||
|
||||
@@ -19,7 +19,7 @@ if [[ -z "$SKIP_CMATRIX_CONFIG" ]]; then
|
||||
brew install cmatrix
|
||||
fi
|
||||
fi
|
||||
echo -e "${GREEN}cmatrix installed successfully!${NC}"
|
||||
log_pass "cmatrix installed successfully!"
|
||||
else
|
||||
echo -e "${YELLOW}Skipping cmatrix configuration${NC}"
|
||||
log_warn "Skipping cmatrix configuration"
|
||||
fi
|
||||
|
||||
@@ -185,5 +185,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
|
||||
killall Dock 2>/dev/null || true
|
||||
else
|
||||
echo -e "${YELLOW}Skipping: Not macOS${NC}"
|
||||
log_warn "Skipping: Not macOS"
|
||||
fi
|
||||
|
||||
@@ -12,4 +12,4 @@ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
sudo apt-get clean -qq
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Cleanup completed successfully!${NC}"
|
||||
log_pass "Cleanup completed successfully!"
|
||||
|
||||
Reference in New Issue
Block a user