-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·38 lines (32 loc) · 999 Bytes
/
setup.sh
File metadata and controls
executable file
·38 lines (32 loc) · 999 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
29
30
31
32
33
34
35
36
37
#!/bin/bash
SCRIPTPATH="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
BASEDIR=`dirname "$SCRIPTPATH"`
function doIt() {
# Note: -T prevents creating of symlink in existing symlinks target, thus replaces the link for folders
ln -n -f -s $BASEDIR/vim ~/.vim
ln -n -f -s $BASEDIR/zsh ~/.zsh
ln -n -f -s $BASEDIR/zsh/zshrc ~/.zshrc
ln -n -f -s $BASEDIR/bin ~/.bin
ln -n -f -s $BASEDIR/git/gitignore ~/.gitignore
if ! type -p git > /dev/null; then
echo "Git is apparently not installed, skipping setup"
else
echo -n "Your Name: "
read GITUSER
echo -n "Your Mail: "
read GITMAIL
git config --global user.name "$GITUSER"
git config --global user.email "$GITMAIL"
git config --global core.excludesfile ~/.gitignore
fi
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt
else
read -p "This may change existing files in your home directory. Are you sure? (y/n) " -n 1
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt
fi
fi
unset doIt