-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathquick_install.sh
More file actions
executable file
·30 lines (25 loc) · 910 Bytes
/
quick_install.sh
File metadata and controls
executable file
·30 lines (25 loc) · 910 Bytes
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
#!/bin/sh -
set -o errexit # exit on fail
set -o nounset # exit on undeclared variable
set -o xtrace # trace execution
# Create ~/.ssh if not exists
mkdir -p ~/.ssh
# Add github's host key to known_hosts (if not yet)
if ! grep github.com ~/.ssh/known_hosts >/dev/null 2>&1; then
command -v ssh-keyscan >/dev/null &&
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
fi
# Clone repository (if not yet)
if [ ! -d ~/.dotfiles ]; then
# First try cloning via ssh (only works if owner of repo)
GIT_TERMINAL_PROMPT=0 \
git clone git@github.com:lainiwa/dotfiles.git ~/.dotfiles ||
# Clone via https otherwise
git clone https://github.com/lainiwa/dotfiles.git ~/.dotfiles
else
git -C ~/.dotfiles/.git pull || true
fi
# Execute installer
~/.dotfiles/install
# Eagerly load zsh plugins
zsh -i -c -- '(( ${+commands[-zplg-scheduler]} )) && -zplg-scheduler burst || true'