-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·49 lines (40 loc) · 1.16 KB
/
install.sh
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
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Install Homebrew if not installed
if ! command -v brew &>/dev/null; then
echo "Homebrew not found. Installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Homebrew is already installed."
fi
# Install all packages from the Brewfile in the current directory
if [ -f "./Brewfile" ]; then
echo "Installing packages from Brewfile..."
brew bundle --file="./Brewfile"
else
echo "No Brewfile found in the current directory."
fi
# Create directories in ~/.config and symlink them using stow
CONFIG_DIR="./config"
if [ -d "$CONFIG_DIR" ]; then
echo "Setting up config directories..."
cd "$CONFIG_DIR" || exit
for dir in *; do
if [ -d "$dir" ]; then
target_dir="$HOME/.config/$(basename "$dir")"
echo "Creating directory $target_dir"
mkdir -p "$target_dir"
echo "Symlinking using stow..."
stow -vt "$target_dir" "$dir"
fi
done
cd - || exit
else
echo "No ./config directory found."
fi
# Symlink .zshrc to the home directory
echo "Copying .zshrc to home directory..."
cp -f "$PWD/.zshrc" "$HOME/.zshrc"
# Install tools
echo "Installing Tools"
go install ./tools/*
echo "Done."