-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·48 lines (37 loc) · 1.48 KB
/
setup.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
#!/usr/bin/env bash
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
if [ "$(uname)" == "Darwin" ]; then
echo "------------------------------"
echo "Installing Xcode Command Line Tools."
# Install Xcode command line tools
if ! xcode-select --version 2>&1 >/dev/null; then
xcode-select --install
fi
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
apt update && apt install -y curl git build-essential
fi
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
export PATH="/opt/homebrew/bin/:/home/linuxbrew/.linuxbrew/bin/brew:$PATH"
# Install dependencies from Brewfile
brew update && brew upgrade
brew bundle --file=~/.dotfiles/Brewfile install
# To install useful key bindings and fuzzy completion:
$(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rc
# Install Node LTS
# https://github.com/tj/n?tab=readme-ov-file#installation
sudo n lts --no-use-xz
sudo chown -R $(whoami) /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share
# Install Node global deps
sudo npm i -g npm-check-updates tsx pnpm
# Create custom directories
mkdir -p $HOME/{repos,Screenshots}
# Create Golang dirs
mkdir -p $HOME/go/{bin,src,pkg}