-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·90 lines (66 loc) · 1.41 KB
/
install.sh
File metadata and controls
executable file
·90 lines (66 loc) · 1.41 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
88
89
90
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
DOTFILES_REPO_DIR=$(
cd "$(dirname "$0")"
pwd -P
)
DOTFILES_DIR="${HOME}/.dotfiles"
ln_dotfile() {
local dotfile
dotfile=$(basename "${1}")
[[ -L "${HOME}/.${dotfile}" ]] && unlink "${HOME}/.${dotfile}"
ln -s "${DOTFILES_DIR}/${1}" "${HOME}/.${dotfile}"
}
ln_dotconfig() {
[[ ! -d "${HOME}/.config" ]] && mkdir "${HOME}/.config"
local config="${1}"
if [ -f "${config}" ]; then
config=$(basename "${config}")
fi
[[ -L "${HOME}/.config/${config}" ]] && unlink "${HOME}/.config/${config}"
ln -s "${DOTFILES_DIR}/${1}" "${HOME}/.config/${config}"
}
# create symlink for dotfiles
[[ -L "${DOTFILES_DIR}" ]] && unlink "${DOTFILES_DIR}"
ln -s "${DOTFILES_REPO_DIR}" "${DOTFILES_DIR}"
# git
ln_dotconfig git
# bash
ln_dotfile bash/bash_completions
ln_dotfile bash/bash_history
ln_dotfile bash/bash_profile
ln_dotfile bash/bash_sessions
ln_dotfile bash/bashrc
# npm
ln_dotfile npm/npmrc
# netrc
ln_dotfile netrc
# direnv
ln_dotconfig direnv
# ssh
ln_dotfile ssh
# maven
ln_dotfile m2
# testcontainers
ln_dotfile testcontainers.properties
# neovim
ln_dotconfig nvim
# scripts
ln_dotfile bin
# bat
ln_dotconfig bat
# eza
ln_dotconfig eza
# fd
ln_dotconfig fd
# lazygit
ln_dotconfig lazygit
# nvm
ln_dotfile nvm
# ghostty
ln_dotconfig ghostty
# tmux
ln_dotfile tmux/tmux.conf
# starship
ln_dotconfig starship/starship.toml