feat: logging, remote widget, ci fix

This commit is contained in:
2026-02-12 16:44:11 +00:00
parent c103e71b07
commit 6164746811
27 changed files with 91 additions and 50 deletions

View File

@@ -28,12 +28,13 @@ fi
# Log functions
log_info() { echo -e "${BLUE}[INFO]${NC} $*"; }
log_pass() { echo -e "${GREEN}[PASS]${NC} $*"; }
log_skip() { echo -e "${GREY}[SKIP]${NC} $*"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
log_error() { echo -e "${RED}[FAIL]${NC} $*"; }
log_debug() { echo -e "${CYAN}$*${NC}"; }
# Export log functions
export -f log_info log_pass log_warn log_error log_debug
export -f log_info log_pass log_skip log_warn log_error log_debug
printf "\n\t${CYAN} <<< ${CYAN_BOLD}dots${CYAN} >>> ${NC}\n"
printf "\t${GREY}==============${NC}\n\n"

View File

@@ -24,3 +24,5 @@ fi
if [[ "$DOTS_ENV" == "codespaces" ]]; then
log_info "Running in GitHub Codespaces"
fi
log_pass "OS detection complete"

View File

@@ -6,7 +6,7 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
if ! command -v brew &> /dev/null; then
echo "Installing Homebrew..."
@@ -16,3 +16,4 @@ else
echo "Homebrew is already installed."
fi
brew --version
log_pass "Homebrew installed"

View File

@@ -6,7 +6,7 @@
#
# apt only
[[ "$DOTS_PKG" != "apt" ]] && { log_warn "Skipping: Not using apt"; return 0; }
[[ "$DOTS_PKG" != "apt" ]] && { log_skip "Not using apt"; return 0; }
apt_packages=(
build-essential
@@ -23,3 +23,4 @@ sudo apt-get install -qq "${apt_packages[@]}"
unset apt_packages
apt --version
log_pass "apt packages installed"

View File

@@ -6,7 +6,7 @@
#
# pacman only
[[ "$DOTS_PKG" != "pacman" ]] && { log_warn "Skipping: Not using pacman"; return 0; }
[[ "$DOTS_PKG" != "pacman" ]] && { log_skip "Not using pacman"; return 0; }
pacman_packages=(
ca-certificates
@@ -32,3 +32,4 @@ fi
pacman --version
yay --version
log_pass "pacman packages installed"

View File

@@ -6,10 +6,10 @@
#
# Skip in Codespaces (managed by GitHub)
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
# Skip if explicitly disabled
[[ -n "$SKIP_SSH_CONFIG" ]] && { log_warn "Skipping SSH configuration"; return 0; }
[[ -n "$SKIP_SSH_CONFIG" ]] && { log_skip "SKIP_SSH_CONFIG is set"; return 0; }
ssh_method="ed25519"
@@ -26,3 +26,4 @@ fi
cat "$ssh_pub"
unset ssh_method ssh_target ssh_key ssh_pub
log_pass "SSH key configured"

View File

@@ -6,7 +6,7 @@
#
# Skip in Codespaces (pre-installed in universal image)
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; git --version; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; git --version; return 0; }
if ! command -v git &> /dev/null; then
case "$DOTS_PKG" in
@@ -27,3 +27,4 @@ if ! command -v git &> /dev/null; then
fi
git --version
log_pass "git configured"

View File

@@ -44,19 +44,10 @@ if [ ! -d "$PLUGIN_DIR/zsh-syntax-highlighting" ]; then
"$PLUGIN_DIR/zsh-syntax-highlighting"
fi
# warn about legacy oh-my-zsh directory
if [ -d "$HOME/.oh-my-zsh" ]; then
log_warn "Legacy ~/.oh-my-zsh directory found. Remove with: rm -rf ~/.oh-my-zsh"
fi
# migrate zoxide database from z if available
if command -v zoxide &>/dev/null && [ -f "$HOME/.z" ]; then
log_info "Importing z database into zoxide..."
zoxide import --from z "$HOME/.z" 2>/dev/null || true
fi
# change default shell to zsh
if [[ "$SHELL" != *zsh ]]; then
sudo chsh -s "$(command -v zsh)" "$(whoami)"
sudo usermod -s "$(command -v zsh)" "$(whoami)"
fi
log_pass "zsh configured"

View File

@@ -44,3 +44,5 @@ stow --dir="$root_dir/files" --target="$HOME/.ssh" dot-ssh
# Bust PATH cache to force regeneration with new profile
rm -f "${XDG_CACHE_HOME:-$HOME/.cache}/dots/path"
log_pass "stow linked"

View File

@@ -24,3 +24,4 @@ if ! command -v tmux &> /dev/null; then
fi
tmux -V
log_pass "tmux installed"

View File

@@ -7,7 +7,7 @@
#
# Skip in Codespaces (use pre-installed versions)
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
# Install mise
if ! command -v mise &>/dev/null; then
@@ -89,3 +89,4 @@ mise exec -- gh --version
mise exec -- terraform --version | head -1
echo "firebase: $(mise exec -- firebase --version)"
echo "fastfetch: $(mise exec -- fastfetch --version 2>&1 | head -1)"
log_pass "mise tools installed"

View File

@@ -7,19 +7,19 @@
#
# skip if SKIP_DOCKER_CONFIG is set
[[ -n "$SKIP_DOCKER_CONFIG" ]] && { log_warn "Skipping: SKIP_DOCKER_CONFIG is set"; return 0; }
[[ -n "$SKIP_DOCKER_CONFIG" ]] && { log_skip "SKIP_DOCKER_CONFIG is set"; return 0; }
# skip if in WSL
if [[ -n "$WSL_DISTRO_NAME" ]]; then
log_warn "Skipping: Running in WSL"
log_skip "Running in WSL"
return 0
fi
# skip if in Codespaces
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
# skip on macOS
[[ "$DOTS_OS" == "macos" ]] && { log_warn "Skipping: macOS"; return 0; }
[[ "$DOTS_OS" == "macos" ]] && { log_skip "macOS"; return 0; }
if ! command -v docker &> /dev/null; then
case "$DOTS_PKG" in
@@ -57,3 +57,4 @@ if ! groups "$USER" | grep -q "\b$docker_group\b"; then
fi
docker --version
log_pass "Docker configured"

View File

@@ -6,7 +6,7 @@
#
# Skip in Codespaces (project-specific tool)
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
if ! command -v az &>/dev/null; then
case "$DOTS_PKG" in
@@ -27,3 +27,4 @@ if ! command -v az &>/dev/null; then
fi
az --version
log_pass "Azure CLI installed"

View File

@@ -6,7 +6,7 @@
#
# Skip in Codespaces (project-specific tool)
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
if ! command -v redis-cli &>/dev/null; then
case "$DOTS_PKG" in
@@ -32,3 +32,4 @@ if ! command -v redis-cli &>/dev/null; then
fi
redis-cli --version
log_pass "Redis installed"

View File

@@ -6,9 +6,9 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
if ! echo "$BREW_CASKS" | grep -q "^iterm2$"; then
brew install --cask iterm2
fi
log_pass "iTerm2 installed successfully!"
log_pass "iTerm2 installed"

View File

@@ -6,7 +6,7 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
fonts_list=(
font-fira-mono-nerd-font
@@ -32,3 +32,4 @@ if [[ "$fonts_missing" == "true" ]]; then
fi
unset fonts_list fonts_missing
log_pass "Nerd Fonts installed"

View File

@@ -6,10 +6,11 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
if ! echo "$BREW_CASKS" | grep -q "^colour-contrast-analyser$"; then
brew install --cask colour-contrast-analyser
else
echo "Colour Contrast Analyser (CCA) is already installed."
fi
log_pass "CCA installed"

View File

@@ -6,10 +6,11 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
if ! echo "$BREW_CASKS" | grep -q "^rectangle$"; then
brew install --cask rectangle
else
echo "Rectangle is already installed."
fi
log_pass "Rectangle installed"

View File

@@ -6,10 +6,11 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
if ! echo "$BREW_CASKS" | grep -q "^meetingbar$"; then
brew install --cask meetingbar
else
echo "MeetingBar is already installed."
fi
log_pass "MeetingBar installed"

View File

@@ -6,10 +6,11 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
if ! echo "$BREW_CASKS" | grep -q "^betterdisplay$"; then
brew install --cask betterdisplay
else
echo "BetterDisplay is already installed."
fi
log_pass "BetterDisplay installed"

View File

@@ -6,10 +6,11 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
if ! echo "$BREW_FORMULAE" | grep -q "^dockutil$"; then
brew install dockutil
else
echo "dockutil is already installed."
fi
log_pass "dockutil installed"

View File

@@ -6,7 +6,7 @@
#
# skip if in Codespaces
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
if ! command -v cmatrix &> /dev/null; then
case "$DOTS_PKG" in
@@ -24,4 +24,4 @@ if ! command -v cmatrix &> /dev/null; then
;;
esac
fi
log_pass "cmatrix installed successfully!"
log_pass "cmatrix installed"

View File

@@ -6,7 +6,7 @@
#
# macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
[[ "$DOTS_OS" != "macos" ]] && { log_skip "Not macOS"; return 0; }
# Keyboard
# --------
@@ -177,4 +177,5 @@ if [[ ! $dock_state == *"spacer"* ]]; then
dockutil --add '' --type spacer --section apps --position "${#dock_order[@]}" --no-restart 2>/dev/null || true
fi
log_info "macOS settings configured. Restart Finder/Dock to apply: osascript -e 'quit app \"Finder\"'"
log_info "Restart Finder/Dock to apply: osascript -e 'quit app \"Finder\"'"
log_pass "macOS defaults configured"

View File

@@ -6,6 +6,7 @@
#
# Skip in Codespaces (cosmetic only)
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
[[ "$DOTS_ENV" == "codespaces" ]] && { log_skip "Codespaces"; return 0; }
fastfetch --pipe false