-
Notifications
You must be signed in to change notification settings - Fork 4
/
install
executable file
·40 lines (32 loc) · 1.33 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
#!/usr/bin/env bash
__DOTFILE_ROOT="${__DOTFILE_ROOT:-${HOME}/.dotfiles}"
source "${__DOTFILE_ROOT}/lib/posix.sh.inc"
# Detect which shell the user is currently running and only install the relevant configurations for
# it. Just keeping things tidy and I can always run this script again in the VERY RARE chance I
# switch shells...
current_shell=$(detect_shell)
case "${current_shell}" in
bash)
safe_symlink ${__DOTFILE_ROOT}/configs/shell/bashrc ${HOME}/.bashrc
;;
zsh)
safe_symlink ${__DOTFILE_ROOT}/configs/shell/zshrc ${HOME}/.zshrc
;;
esac
safe_symlink ${__DOTFILE_ROOT}/configs/git/default ${HOME}/.gitconfig
safe_symlink ${__DOTFILE_ROOT}/configs/tmux/default.conf ${HOME}/.tmux.conf
# Run OS/environment specific setup scripts
case "$(detect_os)" in
termux)
source ${__DOTFILE_ROOT}/scripts/shell_environment/termux/setup.sh.inc
;;
esac
# Switch to the authenticated access for my dotfiles, I most likely cloned over the public HTTPS
# endpoint to get these here. Leave a noauth version in case I want to update without creds
# available...
(
cd ~/.dotfiles/
git remote set-url origin [email protected]:sstelfox/dotfiles.git
git remote | grep -q noauth || git remote add noauth https://github.com/sstelfox/dotfiles.git
git remote | grep -q hollow || git remote add hollow hollow-twilight-ocean.stelfox.net:repos/dotfiles.git
)