-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·34 lines (25 loc) · 970 Bytes
/
install.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
#!/bin/bash
cat <<EOF
Link .{path,bash_prompt,exports,aliases,functions,extra,gitconfig}, bin to ~
EOF
touch .gitconfig.includes
touch .gitconfig.local
touch .exports.local
for file in .{path,bash_prompt,exports,exports.local,aliases,functions,extra,gitconfig,gitconfig.includes,gitconfig.local,npm-init.js}; do
[ -r "$file" ] && [ -f "$file" ] && ln -s $PWD/$file $HOME/$file
done
ln -s $PWD/bin $HOME/bin
# VSCode
mv $HOME/Library/Application\ Support/Code/User/keybindings.json $HOME/Library/Application\ Support/Code/User/keybindings.json.bak
ln -s $PWD/.vscode/keybindings.json $HOME/Library/Application\ Support/Code/User/keybindings.json
function append() {
local text="$1" file="$2"
[[ -f $file ]] && touch $file
if ! grep -q "$text" "$file"; then
echo "$text" >>"$file"
fi
}
# Fetching public keys
echo "Fetching public keys..."
mkdir -p $HOME/.ssh
append "$(curl https://github.com/yulers.keys)" $HOME/.ssh/authorized_keys