-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcopy-dotfiles
executable file
·32 lines (29 loc) · 1.07 KB
/
copy-dotfiles
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
#!/bin/bash
for dotfiles_file in $(ls -A .); do
if [[ -f $dotfiles_file ]]; then
if [[ $dotfiles_file != ".gitconfig"
&& $dotfiles_file != ".gitmodules"
&& $dotfiles_file != "README.md"
&& $dotfiles_file != "LICENSE"
&& $dotfiles_file != "copy-dotfiles"
&& $dotfiles_file != ".git"
&& $dotfiles_file != ".gitignore" ]]; then
ln -s $dotfiles_file ~
elif [[ $dotfiles_file == ".gitconfig" ]]; then
echo "Please input your git user.name"
read username
echo "Enter your git user.email"
read useremail
echo "[user]
name = $username
email = $useremail" > ~/.gitconfig
cat ./.gitconfig >> ~/.gitconfig
fi
elif [[ -d $dotfiles_file ]]; then
if [[ $dotfiles_file != ".git" && $dotfiles_file != "config" ]]; then
ln -s ./$dotfiles_file ~/
elif [[ $dotfiles_file == "config" ]]; then
ln -s $dotfiles_file/* ~/.config/
fi
fi
done