-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·98 lines (83 loc) · 2.25 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env bash
set -eEuo pipefail
printf "Configuration:\n"
IGNORE_OMZ=${IGNORE_OMZ:-false}
IGNORE_BREW=${IGNORE_BREW:-true}
REMOTE_CONTAINERS=${REMOTE_CONTAINERS:-false}
if [[ ${REMOTE_CONTAINERS} ]]; then
IGNORE_OMZ=true
IGNORE_BREW=true
IGNORE_CODE=true
fi
printf " - IGNORE_OMZ = %s\n" "${IGNORE_OMZ}"
printf " - IGNORE_BREW = %s\n" "${IGNORE_BREW}"
# for devcontainers, it's best to install locally and anywhere
# sudo is not required
mkdir -p ~/bin
###
# Rust
###
if ! command -v 'rustc' &>/dev/null; then
printf "\n🦀 Installing rust\n"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
###
# Starship
###
if [[ -z "$(which starship)" ]] ; then
printf "\n🚀 Installing starship\n"
curl -fsSL https://starship.rs/install.sh | bash -s -- --yes -b ~/bin
fi
###
# Skim
###
if [[ -f "~/.skim/shell/completion.zsh" ]] ; then
printf "\n🚀 Installing skim\n"
git clone --quiet https://github.com/lotabout/skim.git ~/.skim
fi
###
# Essential Rust utilities
# For more utils, see rust-update.sh
###
cargo install bat fd-find git-delta exa skim
###
# Install oh my zsh
###
if ! ${IGNORE_OMZ}; then
printf "\n🚀 Installing oh-my-zsh\n"
if [ -d "${HOME}/.oh-my-zsh" ]; then
printf "oh-my-zsh is already installed\n"
else
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
fi
###
# Install brew to start with
###
if [[ ! ${IGNORE_BREW} && "$OSTYPE" == "darwin"* ]]; then
printf "\n🚀 Installing brew\n"
if [ "$(arch)" = "arm64" ]; then
printf "\nRunning on arm64\n"
if ! brew --version; then
sudo mkdir -p /opt/homebrew
sudo chown -R "$(whoami)":wheel /opt/homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /opt/homebrew
fi
else
printf "\nRunning on intel\n"
if ! brew --version; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
fi
brew update
brew upgrade
###
# Install brew packages
###
pushd ~/macos || exit
brew bundle
popd || exit
# Some tidying up
brew autoremove
brew cleanup
fi