-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup1-brew.sh
More file actions
39 lines (32 loc) · 1.11 KB
/
setup1-brew.sh
File metadata and controls
39 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
readonly GREEN='\033[32m'
readonly YELLOW='\033[33m'
readonly NC='\033[0m' # No Color
print_message() {
local color="$1"
local message="$2"
printf "${color}%s${NC}\n" "$message"
}
if ! xcode-select -p &>/dev/null; then
print_message "$YELLOW" "Xcode Command Line Tools not found. Installing..."
xcode-select --install
else
print_message "$GREEN" "Xcode Command Line Tools are already installed."
fi
if ! command -v brew &>/dev/null; then
print_message "$YELLOW" "Homebrew not found. Installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
else
print_message "$GREEN" "Homebrew is already installed. Updating..."
fi
brew update
brew upgrade
brew doctor
brew bundle
brew bundle dump --force --file=- | grep -v "^vscode " > Brewfile # 結果を標準出力に強制, vscodeの拡張はvscode側で管理しているので除く
if ! command -v vp &> /dev/null; then
echo "vp command not found. Installing Vite+..."
curl -fsSL https://vite.plus | bash
fi
print_message "$GREEN" "Setup completed!"