-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·87 lines (75 loc) · 2.26 KB
/
install
File metadata and controls
executable file
·87 lines (75 loc) · 2.26 KB
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
#!/bin/bash
# Submodules
git submodule init && git submodule update
# Homebrew
if [ "$(uname)" == "Darwin" ]; then
if ! [ -x "$(command -v brew)" ]; then
echo "Please install homebrew."
exit 1
fi
brew bundle --quiet
fi
# Shell
cp aliases "$HOME"/.aliases
mkdir -p "$HOME"/.config/fish
cp shrc "$HOME"/.config/fish/config.fish
cp starship.toml "$HOME"/.config/starship.toml
# Linux gnome-terminal padding
if [ "$(uname)" == "Linux" ]; then
mkdir -p ~/.config/gtk-3.0
cp gtk.css ~/.config/gtk-3.0/gtk.css
fi
# GNU Screen
cp screenrc "$HOME"/.screenrc
# Git
cp gitattributes ~/.gitattributes
cp gitignore "$HOME"/.gitignore
GIT_EMAIL=$(git config --global --get user.email)
export GIT_EMAIL
if [ -z "$GIT_EMAIL" ]; then
read -r -p "Email for Git (<user>@users.noreply.github.com): " email
export GIT_EMAIL=$email
fi
GIT_SIGNINGKEY=$(git config --global --get user.signingkey)
export GIT_SIGNINGKEY
if [ -z "$GIT_SIGNINGKEY" ]; then
read -r -p "Signing Key for Git (from ssh-add -L): " signingkey
GIT_SIGNINGKEY=$signingkey
export GIT_SIGNINGKEY
fi
eval echo "\"$(cat gitconfig.template)\"" > "$HOME"/.gitconfig
# Terraform
cp terraformrc "$HOME/.terraformrc"
# Vim
mkdir -p "$HOME"/.vimswap
cp vimrc "$HOME"/.vimrc
mkdir -p "$HOME"/.config/nvim
cp init.vim "$HOME"/.config/nvim/init.vim
# ...plugins
mkdir -p ~/.vim/pack/plugins/start
# symlink my vendored submodules into the vim packages system
find dotvim/vendor -maxdepth 1 -mindepth 1 -type d | while read -r dir; do
symlink="$(basename "$dir")"
if [ ! -e ~/.vim/pack/plugins/start/"$symlink" ]; then
ln -s "$PWD/$dir" ~/.vim/pack/plugins/start/"$symlink"
fi
done
mkdir -p ~/.vim/ftplugin
find dotvim/ftplugin -maxdepth 1 -mindepth 1 -type f | while read -r ftplugin; do
cp "$ftplugin" ~/.vim/ftplugin/.
done
# Ubuntu configuration
if [ -e /etc/lsb-release ]; then
# shellcheck disable=SC1091
. /etc/lsb-release
if [ "$DISTRIB_ID" == "Ubuntu" ]; then
if [ ! -e /usr/bin/ansible-playbook ]; then
sudo apt update
sudo apt install software-properties-common --yes
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible-core --yes
fi
ansible-playbook ubuntu.yaml -K -e "user=$(whoami)"
fi
fi
echo "Your dotfiles have been copied to $HOME"