-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·28 lines (21 loc) · 758 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·28 lines (21 loc) · 758 Bytes
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
#!/bin/bash
# Only explore this folder level
# Only return "dotfiles"
find . -maxdepth 1 -name ".*" | while read fname; do
regex="^\./(\.[a-zA-Z0-9_\.]+)$"
if [[ $fname =~ $regex ]]; then
name="${BASH_REMATCH[1]}"
rm -v $HOME/$name
ln -fs $PWD/$name $HOME/$name
echo symlinked: $HOME/$name "-->" $PWD/$name
fi
done
# TODO: handle the .vimconfig directory as well
# - `rmdir $HOME/.vimconfig`
# - `ls -s ...etc`
# create dynamic file to store the latest location of dotfiles folder
# needs to be recreated every time the DOTFILES/setup.h is run in
# case location of dotfiles local repo changes
echo 'export DOTFILES='`pwd` >> $HOME/.dotfiles_temp
# RE-source bashrc and can now check if new setup is proper
source ~/.bashrc