34 lines
503 B
Bash
34 lines
503 B
Bash
|
#!/bin/bash
|
||
|
# Save the current working directory
|
||
|
DIR=$(pwd)
|
||
|
|
||
|
# TODO: Pretty colours (from holman)
|
||
|
|
||
|
# Go to the home directory
|
||
|
cd ~
|
||
|
|
||
|
# Begin Symlinks
|
||
|
echo "Linking dotfiles..."
|
||
|
|
||
|
LINKS='zshrc
|
||
|
gitconfig
|
||
|
gitconfig_work
|
||
|
gitignore_global
|
||
|
npmrc'
|
||
|
|
||
|
echo
|
||
|
for L in $LINKS; do
|
||
|
# check if the LINK exists, back up the existing version
|
||
|
if [[ -e ".$L" ]]; then
|
||
|
echo "Backing up .$L"
|
||
|
mv ".$L" ".$L.backup"
|
||
|
fi
|
||
|
|
||
|
echo "Linking .$L"
|
||
|
ln -s "$DIR/$L" ".$L"
|
||
|
done
|
||
|
echo
|
||
|
|
||
|
echo "Done linking dotfiles."
|
||
|
# End Symlinks
|