So...this has evolved to a little bit more than dotfiles over the years. At this point, this repo represents dotfiles, as well as applications and configuration.
If you think this is a little overboard...
bin/setup
is used to apply all of the changes to the target system. Each change is represented by a delta (file) in
lib/deltas. These delta files each implement (at least) two functions:
applied
- Determines whether or not this delta has been applied alreadyapply
- Performs the necessary steps for applying the delta
Delta scripts can also define options and validate them (see lib/deltas/ruby.sh for an example).
bin/setup
- Ensuresbrew
is installed (if running on OSX), and symlinks all files in./files
to~/
bin/setup -a
- Same as above, but also applies a bunch of other deltas (see lib/phases.sh)
You can always, just clone the repo and run bin/setup
.
You can also eval "$(curl -fsSL https://raw.github.com/karlhungus/dotfiles/master/bootstrap.sh)"
on a fresh machine.
This will download (not clone, git might not be installed yet) this repo to ~/dotfiles
and run bin/setup
(just
dotfiles...in case it's a shared system or something)
When you run bin/setup
, the deltas are called via bin/apply <delta> [<delta_args>]
. E.g. bin/apply git -v 2.9.2
.
The apply script will check if the delta has already been applied and if so, will notify the setup script that the delta
has already been applied (nothing to do). Otherwise, it will call apply
and if successful, will call applied
to
verify that the change has actually occurred.