-
Notifications
You must be signed in to change notification settings - Fork 2
/
install
executable file
·94 lines (77 loc) · 3.15 KB
/
install
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
#!/usr/bin/env bash
set -euo pipefail
set_up_doom() {
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
~/.config/emacs/bin/doom install
}
set_up_languages () {
npm i -g npm
npm i -g @elm-tooling/elm-language-server elm-format elm-live elm-review elm-test
python -m pip install --upgrade pip
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
}
set_up_vim () {
if [ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim ]; then
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
printf '\x1b[0;32mVim-plug has been installed.\x1b[0m\n'
else
printf '\x1b[0;33mVim-plug is already installed.\x1b[0m\n'
fi
nvim -e -u ~/.config/nvim/init.vim -i NONE -c "PlugInstall" -c "GoInstallBinaries" -c "qa"
nvim -e -u ~/.config/nvim/init.vim -i NONE -c "TSInstall bash elm fish go javascript python ruby rust solidity typescript vim" -c "qa"
echo 'Wait for CoC to install its plugins before exiting.' | nvim -R -
}
shared_setup () {
set_up_doom
set_up_fisher
set_up_languages
set_up_vim
}
os_name="$(uname -s)"
echo "Setting up $os_name..."
if [ "$os_name" = "Darwin" ]; then
if [ ! "$(xcode-select --version)" = "" ]; then
printf '\x1b[0;32mXCode is already installed.\x1b[0m\n'
else
if xcode-select --install; then
printf '\x1b[0;32mInstalled XCode.\x1b[0m\n'
else
printf '\x1b[0;31mFailed to install XCode. Exiting.\x1b[0m\n' && exit 1
fi
fi
if sudo softwareupdate --install-rosetta --agree-to-license; then
printf '\x1b[0;32mInstalled Rosetta.\x1b[0m\n'
else
printf '\x1b[0;31mFailed to install Rosetta. Exiting.\x1b[0m\n' && exit 1
fi
sudo softwareupdate -ir
printf '\x1b[0;32mAttempted to install recommended updates.\x1b[0m\n'
if [ ! -d /opt/homebrew/ ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew bundle install --file Brewfile
RCRC="$HOME"/.dotfiles/rcrc rcup -t mac
ln -s ~/.dotfiles/karabiner/ ~/.config/karabiner
# disable "smart" quotes
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
chromedir="$(echo "$HOME"/Library/Application\ Support/Firefox/Profiles/*default-release/chrome)"
mkdir -p chromedir
if [ ! -f "$chromedir/userChrome.css" ]; then
ln -s "$HOME"/.dotfiles/userChrome.css "$chromedir"/userChrome.css
printf '\x1b[0;32mFirefox styling applied.\x1b[0m\n'
else
printf '\x1b[0;33mFirefox styling already exists.\x1b[0m\n'
fi
shared_setup
elif [ "$os_name" = "Linux" ]; then
printf '\x1b[0;31mUpdate the install script for Linux!\x1b[0m\n'
# TODO: install software
# RCRC="$HOME"/.dotfiles/rcrc rcup -d ~/.dotfiles -t linux
# TODO: settings
# TODO: Firefox styling
# TODO: shared setup
else
printf '\x1b[0;31mNo installation set up for %s yet\x1b[0m\n' "$os_name"
fi
printf '\x1b[0;32mSetup complete!\x1b[0m\n'