Created
October 5, 2014 17:16
-
-
Save pesterhazy/cb1081f1ff0c886db9fe to your computer and use it in GitHub Desktop.
symlink dotfiles in your dropbox folder to your $HOME
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dropbox-update-dotfiles () { | |
src="$HOME/Dropbox/Linux/dotfiles" | |
dst="$HOME" | |
if [[ ! -d "$src" ]]; then | |
print Using $HOME/dotfiles. | |
src="$HOME/dotfiles" | |
fi | |
if [[ ! -d "$src" ]]; then | |
print "Directory $src not found." | |
fi | |
for f in "$src"/*~*(.swp|~|.pyc)(D); do | |
if [[ "${f:t}" != ".lein" ]]; then | |
if [[ -h "$dst/${f:t}" ]]; then | |
# exists as symlink | |
elif [[ -e "$dst/${f:t}" ]]; then | |
print "WARNING: ${f:t} exists, but is not a symlink." | |
else | |
ln -sv "$f" "$dst" | |
fi | |
fi | |
done | |
# update some files manually | |
# | |
echo updating manually... | |
mkdir -p ~/.lein | |
_try_ln "$src" "$dst" ".lein/profiles.clj" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment