-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·58 lines (44 loc) · 2.07 KB
/
bootstrap.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
#!/usr/bin/env bash
# Sets the current directory in the process to the dotfiles directory.
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
# Create a symlink for .gitmessage and set the contents of ~/.gitmessage as the commit template.
ln -sf "$PWD"/.gitmessage "$HOME"/.gitmessage
git config --global commit.template "$HOME"/.gitmessage
# Set the default name and email for commits.
git config --global user.name "Max Curran"
git config --global user.email "[email protected]"
# Ensure git uses ssh instead of HTTPS. This is particularly useful for installing vim plugins.
git config --global --add url."[email protected]:".insteadOf "https://github.com/"
# Exclude /scratch directories from any local git repository
git config --global core.excludesFile "$HOME"/.gitignore.global
if [ ! -f "$HOME"/.gitignore.global ]; then
echo '/_scratch' >> ~/.gitignore.global
echo '/scratch' >> ~/.gitignore.global
fi
# Ensure all git commits are signed by a GPG key.
git config --global commit.gpgsign true
git config --global user.signingkey "$(pass Personal/gpg_signing_key)"
# Additional git configuration.
git config --global branch.sort -committerdate
git config --global rerere.enabled true
# Create symlinks for .aliases and ZSH configuration files.
ln -sf "$PWD"/.aliases "$HOME"/.aliases
ln -sf "$PWD"/.zshrc "$HOME"/.zshrc
ln -sf "$PWD"/.zprofile "$HOME"/.zprofile
# neovim configuration.
ln -sf "$PWD"/nvim "$HOME"/nvim
# WezTerm configuration
ln -sf "$PWD"/wezterm/wezterm.lua "$HOME"/.wezterm.lua
# starship configuration
mkdir -p "$HOME"/.config
ln -sf "$PWD"/starship/starship.toml "$HOME"/.config/starship.toml
# Source these during bootstrapping to reflect changes in the current shell session.
source "$HOME"/.zshrc "$HOME"/.zprofile
# Create ~/.local/bin if it doesn't exist already, and create the symlink for bm.
mkdir -p "$HOME"/.local/bin
ln -sf "$PWD"/bm "$HOME"/.local/bin
# Install and manage any Homebrew-related dependencies.
bm
# Install any software/dependencies outside of Homebrew.
# Generally this requires fetching a file from some server and running `sh`.
sh "installers.sh"