-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot.sh
executable file
路29 lines (22 loc) 路 1.01 KB
/
dot.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
#!/bin/bash
# install.sh
# Install script for the dotfiles to the home directory
#
# Add or remove any file you want to copy to the dotfiles list
# Please remmember to change the git credentials in the gitconfig file
# and use yours... if not you are gonna be commiting with my name everywhere!
# dir where the originals are located: just the parent of the dir where this
# script is located
dotfiles_dir="$(cd "$(dirname "$0")"; pwd)/../"
# list of files to symlink in homedir
dotfiles="aliases bash_profile bash_prompt bashrc exports extras functions gitattributes gitconfig gitignore inputrc path vimrc"
echo "Getting dotfiles ready!"
mkdir -p ~/.dotfiles_old # backup folder for all the current dotfiles
# create symlinks for all the listed files
for dot in $dotfiles; do
if [ -f ~/.$dot ]; then
mv ~/.$dot ~/.dotfiles_old/ # if file already exists, backup it!
fi
ln -s $dotfiles_dir/$dot ~/.$dot # create a symlink of the file in the homedir
done
echo "Successfully created symlinks for the dotfiles."