2 changed files with 18 additions and 20 deletions
@ -1,24 +1,22 @@ |
|||||
#!/bin/bash |
#!/bin/sh |
||||
|
|
||||
SCRIPT=$(readlink -f "$0") |
SCRIPT=$(readlink -f "$0") |
||||
SCRIPTPATH=$(dirname "$SCRIPT") |
SCRIPTPATH=$(dirname "$SCRIPT") |
||||
HOST=`hostname` |
HOST=$(hostname) |
||||
|
|
||||
# List of the config files to install |
# List of the config files to install |
||||
FILES="vimrc zshrc gitconfig vim gitignore_global git_user" |
FILES="vimrc zshrc gitconfig vim gitignore_global git_user" |
||||
|
|
||||
if [[ ! -e $HOME/.git_user ]] |
if [ ! -e "$HOME/.git_user" ]; then |
||||
then |
cp "$SCRIPTPATH/git_user.def" "$SCRIPTPATH/git_user" |
||||
cp $SCRIPTPATH/git_user.def $SCRIPTPATH/git_user |
sed -i -e "s/{username}/$USER/" "$SCRIPTPATH/git_user" |
||||
sed -i -e "s/{username}/$USER/" $SCRIPTPATH/git_user |
sed -i -e "s/{email}/$USER@$HOST/" "$SCRIPTPATH/git_user" |
||||
sed -i -e "s/{email}/$USER@$HOST/" $SCRIPTPATH/git_user |
|
||||
fi |
fi |
||||
|
|
||||
# Create symbolic links in the user's home dir |
# Create symbolic links in the user's home dir |
||||
for file in $FILES |
for file in $FILES |
||||
do |
do |
||||
if [ ! -e $HOME/.${file} ] |
if [ ! -e "$HOME/.${file}" ]; then |
||||
then |
ln -s "${SCRIPTPATH}/${file}" "$HOME/.${file}" |
||||
ln -s ${SCRIPTPATH}/${file} $HOME/.${file} |
|
||||
fi |
fi |
||||
done |
done |
||||
|
|||||
Loading…
Reference in new issue