-
Notifications
You must be signed in to change notification settings - Fork 87
Filters
twe4ked edited this page Mar 18, 2013
·
12 revisions
Filters allow you to run specified files through arbitrary commands at build time.
Setting name and email with environment variables in gitconfig.erb
.
# ~/.freshrc
fresh config/gitconfig.erb --file=~/.gitconfig --filter=erb
# ~/.dotfiles/config/gitconfig.erb
[user]
name=<%= ENV["NAME"] %>
email=<%= ENV["EMAIL"] %>
Decrypting files with GnuPG.
# ~/.freshrc
fresh encrypted_file.asc --filter=gpg
You can use sed
to grab parts of a file. Here is an example of getting rbenv
initialization lines. We've also locked the file to a certain git ref in case the line numbers change.
# ~/.freshrc
fresh jasoncodes/dotfiles shell/profile --ref=452fb01 --filter='sed -n 224,227p'