-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotsystem.sh
111 lines (96 loc) · 3.93 KB
/
dotsystem.sh
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/zsh
zparseopts -D -K -- \
-init=init \
-link=ln \
-brew=brew \
-update=update \
-nvim=nvim
echo "▓█████▄ ▒█████ ▄▄▄█████▓ ██████▓██ ██▓ ██████ ▄▄▄█████▓▓█████ ███▄ ▄███▓
▒██▀ ██▌▒██▒ ██▒▓ ██▒ ▓▒▒██ ▒ ▒██ ██▒▒██ ▒ ▓ ██▒ ▓▒▓█ ▀ ▓██▒▀█▀ ██▒
░██ █▌▒██░ ██▒▒ ▓██░ ▒░░ ▓██▄ ▒██ ██░░ ▓██▄ ▒ ▓██░ ▒░▒███ ▓██ ▓██░
░▓█▄ ▌▒██ ██░░ ▓██▓ ░ ▒ ██▒ ░ ▐██▓░ ▒ ██▒░ ▓██▓ ░ ▒▓█ ▄ ▒██ ▒██
░▒████▓ ░ ████▓▒░ ▒██▒ ░ ▒██████▒▒ ░ ██▒▓░▒██████▒▒ ▒██▒ ░ ░▒████▒▒██▒ ░██▒
▒▒▓ ▒ ░ ▒░▒░▒░ ▒ ░░ ▒ ▒▓▒ ▒ ░ ██▒▒▒ ▒ ▒▓▒ ▒ ░ ▒ ░░ ░░ ▒░ ░░ ▒░ ░ ░
░ ▒ ▒ ░ ▒ ▒░ ░ ░ ░▒ ░ ░▓██ ░▒░ ░ ░▒ ░ ░ ░ ░ ░ ░░ ░ ░
░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ▒ ▒ ░░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ "
# Runs on initial setup, but never again
function setup_first {
echo "Installing xcode"
xcode-select --install
echo "Installing brew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
}
# Runs when ever --ln is used and will relink all dotfiles
function setup_env {
# Set up all symlinks before doing anything else
echo "Creating ~/ symlinks"
ln -sf ~/.dotfiles/.zshrc ~/.zshrc
ln -sf ~/.dotfiles/.fzf.zsh ~/.fzf.zsh
ln -sf ~/.dotfiles/.gitconfig ~/.gitconfig
ln -sf ~/.dotfiles/.gitignore ~/.gitignore
# All files and folders under ./config will be symlinked into
# the current $HOME/.config/ directory
echo "Creating ~/.config symlinks"
for i in ~/.dotfiles/.config/*; do
RESOURCE="$(basename "$i")"
ln -sf ~/.dotfiles/.config/${RESOURCE} ~/.config
done
}
# Runs when ever --brew is supplied and will do brew stuff
function brew_sync {
echo "Checking for removed packages"
brew bundle cleanup --force --file ~/.dotfiles/Brewfile
echo "Installing new packages"
brew bundle --file ~/.dotfiles/Brewfile
}
# Update brew and all other dependencies
function update {
brew_sync
echo "Updating gh-notify"
gh ext upgrade meiji163/gh-notify
}
# Install misc items last
function setup_last {
# Install gh plugins at first install
gh ext install meiji163/gh-notify
}
# Installs nvim nightly if feeling... adventurous
function nvim_nightly {
# mkdir ~/.nvim
# curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-arm64.tar.gz
# xattr -c nvim-macos-arm64.tar.gz
# tar xzvf nvim-macos-arm64.tar.gz -C ~/.nvim
# # Cleanup
# rm nvim-macos-arm64.tar.gz
}
if (($#nvim)); then
echo "Installing nvim nightly"
nvim_nightly
echo "Installing nvim nightly finished"
fi
if (($#ln)); then
echo "Dotlinker running"
setup_env
echo "Dotlinker finished"
fi
if (($#brew)); then
echo "Brew running"
brew_sync
echo "Brew finished"
fi
if (($#update)); then
echo "Update running"
brew_sync
update
echo "Update finished"
fi
if (($#init)); then
echo "Running firstime setup"
setup_first
setup_env
brew
setup_last
echo "Complete first time setup"
fi