fix: brew env
This commit is contained in:
@@ -6,14 +6,14 @@ set -eo pipefail
|
||||
#
|
||||
|
||||
if [[ -t 1 && -n "$TERM" && "$TERM" != "dumb" ]]; then
|
||||
BLUE="\033[0;34m"
|
||||
CYAN="\033[0;36m"
|
||||
CYAN_BOLD="\033[1;36m"
|
||||
RED="\033[1;31m"
|
||||
GREEN="\033[1;32m"
|
||||
YELLOW="\033[1;33m"
|
||||
GREY="\033[1;30m"
|
||||
NC="\033[0m"
|
||||
BLUE=$'\033[38;2;12;72;204m'
|
||||
CYAN=$'\033[38;2;0;228;252m'
|
||||
CYAN_BOLD=$'\033[1;38;2;0;228;252m'
|
||||
RED=$'\033[38;2;244;4;4m'
|
||||
GREEN=$'\033[38;2;44;180;148m'
|
||||
YELLOW=$'\033[38;2;252;252;56m'
|
||||
GREY=$'\033[38;2;128;128;128m'
|
||||
NC=$'\033[0m'
|
||||
else
|
||||
BLUE=""
|
||||
CYAN=""
|
||||
@@ -78,6 +78,16 @@ case "$OSTYPE" in
|
||||
;;
|
||||
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
|
||||
if [ -L "$0" ]; then
|
||||
dir=$(dirname $(readlink -f "$0"))
|
||||
|
||||
@@ -8,15 +8,6 @@
|
||||
# macOS only
|
||||
[[ "$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
|
||||
echo "Installing Homebrew..."
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
|
||||
@@ -25,12 +25,10 @@ echo "npm $(npm --version)"
|
||||
|
||||
npm_dependencies=(
|
||||
"firebase-tools"
|
||||
# "neovim"
|
||||
# "typescript-language-server"
|
||||
# "typescript"
|
||||
"@github/copilot"
|
||||
)
|
||||
|
||||
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
|
||||
npm install -g "${npm_dependencies[@]}"
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user