2023-10-01 18:42:33 +00:00
|
|
|
#!/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
|
2023-10-01 19:20:42 +00:00
|
|
|
|
|
|
|
# Set up macOS defaults
|
|
|
|
./scripts/set-mac-defaults.sh
|