Skip to content

Instantly share code, notes, and snippets.

@emptyset
Created February 27, 2012 19:51
Show Gist options
  • Save emptyset/1926604 to your computer and use it in GitHub Desktop.
Save emptyset/1926604 to your computer and use it in GitHub Desktop.
Trying out github's gist feature by sharing the small update script I use to maintain my dotfiles across different systems using Dropbox.
#!/usr/bin/env zsh
# This configuration file script will create links to the various
# dotfiles and directories in the user's home directory. This allows
# for the .configuration directory to be "dropped" in and immediately
# setup the shell, keys, editor settings, environment variables, etc.
# Instructions
#
# 1. Setup a link called ".configuration" that points to the dotfiles
# directory:
#
# $ ln -s ~/Dropbox/.configuration .configuration
#
# This allows for storing the dotfiles at a location that synchs
# files across different computers, like Dropbox. Otherwise,
# dropping the dotfiles into a .configuration directory works as
# well.
#
# NOTE: .git directory is ignored, so that you can track the changes
# to your dotfiles (like I do).
#
# 2. Switch to .configuration and run this script.
#
# $ cd ~/.configuration
# $ ./update.sh
#
# This creates symbolic links to all your dotfiles in your home
# directory.
# List out the dotfiles in the .configuration directory.
ls -A1 -I '.git' ~/.configuration |
# Pull out the file names on separate lines from the output.
awk '/^\./ { print $0 }' |
# Pass each file name to create a link to the file in .configuration.
xargs -I {} ln -fs .configuration/{} ~/{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment