forked from AdamWhittingham/adshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·67 lines (55 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
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
#!/bin/sh
append_to_file() {
local text="$1"
local file="$2"
if ! grep -Fsq "$text" "$file"; then
printf "\n%s\n" "$text" >> "$file"
fi
}
install_dependencies() {
if which brew >/dev/null; then
brew bundle --no-lock -v
echo
echo "Common dependencies installed."
else
echo "Brew not found- please install dependencies manually. See the README.md"
fi
}
append_git_config(){
git_config="[include]
path = ~/.mshell/gitconfig"
append_to_file "$git_config" $HOME/.gitconfig
}
source_custom(){
source_cmd="source $HOME/.mshell/custom"
append_to_file "$source_cmd" $HOME/.bashrc
append_to_file "$source_cmd" $HOME/.zshrc
}
symlink_ctags_config(){
ln -s ~/.mshell/ctags ~/.ctags
}
symlink_gitignore(){
ln -s ~/.mshell/gitignore_global ~/.gitignore_global
}
symlink_asdf_configs(){
ln -s ~/.mshell/asdf/asdfrc ~/.asdfrc
ln -s ~/.mshell/asdf/default-gems ~/.default-gems
ln -s ~/.mshell/asdf/default-npm-packages ~/.default-npm-packages
}
symlink_configs(){
ln -s ~/.mshell/config/kitty ~/.config/
ln -s ~/.mshell/config/wezterm ~/.config/
ln -s ~/.mshell/config/vale.ini ~/.vale.ini
}
main(){
pushd $(dirname $0) > /dev/null
install_dependencies
symlink_ctags_config
append_git_config
symlink_gitignore
symlink_asdf_configs
source_custom
symlink_configs
popd > /dev/null
}
main