fix: brew env

This commit is contained in:
2025-12-23 21:44:10 +02:00
parent 891ae505f8
commit 7b5e4e12d2
4 changed files with 20 additions and 37 deletions

View File

@@ -6,14 +6,14 @@ set -eo pipefail
# #
if [[ -t 1 && -n "$TERM" && "$TERM" != "dumb" ]]; then if [[ -t 1 && -n "$TERM" && "$TERM" != "dumb" ]]; then
BLUE="\033[0;34m" BLUE=$'\033[38;2;12;72;204m'
CYAN="\033[0;36m" CYAN=$'\033[38;2;0;228;252m'
CYAN_BOLD="\033[1;36m" CYAN_BOLD=$'\033[1;38;2;0;228;252m'
RED="\033[1;31m" RED=$'\033[38;2;244;4;4m'
GREEN="\033[1;32m" GREEN=$'\033[38;2;44;180;148m'
YELLOW="\033[1;33m" YELLOW=$'\033[38;2;252;252;56m'
GREY="\033[1;30m" GREY=$'\033[38;2;128;128;128m'
NC="\033[0m" NC=$'\033[0m'
else else
BLUE="" BLUE=""
CYAN="" CYAN=""
@@ -78,6 +78,16 @@ case "$OSTYPE" in
;; ;;
esac esac
# Set up Homebrew environment
if [[ "$DOTS_PKG" == "brew" ]]; then
NONINTERACTIVE=1
HOMEBREW_NO_ANALYTICS=1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
HOMEBREW_NO_ENV_HINTS=1
HOMEBREW_NO_AUTO_UPDATE=1
HOMEBREW_NO_INSTALL_CLEANUP=1
fi
# Set up directory variables # Set up directory variables
if [ -L "$0" ]; then if [ -L "$0" ]; then
dir=$(dirname $(readlink -f "$0")) dir=$(dirname $(readlink -f "$0"))

View File

@@ -8,15 +8,6 @@
# macOS only # macOS only
[[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; } [[ "$DOTS_OS" != "macos" ]] && { log_warn "Skipping: Not macOS"; return 0; }
if [ -d "/opt/homebrew/bin" ]; then
export PATH="/opt/homebrew/bin:$PATH"
fi
export NONINTERACTIVE=1
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
if ! command -v brew &> /dev/null; then if ! command -v brew &> /dev/null; then
echo "Installing Homebrew..." echo "Installing Homebrew..."
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

View File

@@ -25,12 +25,10 @@ echo "npm $(npm --version)"
npm_dependencies=( npm_dependencies=(
"firebase-tools" "firebase-tools"
# "neovim" "@github/copilot"
# "typescript-language-server"
# "typescript"
) )
npm_dependencies=($(comm -13 <(printf "%s\n" "${npm_dependencies[@]}" | sort) <(npm list -g --depth=0 --parseable | awk -F'/' '{print $NF}' | sort))) npm_dependencies=($(comm -23 <(printf "%s\n" "${npm_dependencies[@]}" | sort) <(npm list -g --depth=0 --parseable | awk -F'/' '{print $NF}' | sort)))
if [ ${#npm_dependencies[@]} -gt 0 ]; then if [ ${#npm_dependencies[@]} -gt 0 ]; then
npm install -g "${npm_dependencies[@]}" npm install -g "${npm_dependencies[@]}"

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# Description:
# Install GitHub Copilot CLI.
#
if ! command -v copilot &>/dev/null; then
if command -v npm &>/dev/null; then
npm install -g @github/copilot
else
log_warn "Skipping GitHub Copilot CLI install: npm not found"
fi
fi
copilot --version