From 8dbd5a9b215622e3f2cbfb0b43b1e34d923f2797 Mon Sep 17 00:00:00 2001 From: Joshua Nichols Date: Wed, 27 Oct 2010 10:09:24 -0400 Subject: [PATCH] Spiked homesickrc support. Create a .homesickrc in a castle, and you will be prompted to eval it at clone. Runs in castle directory, and runs in the context of a Homesick instance --- lib/homesick.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/homesick.rb b/lib/homesick.rb index 86612fe..f439542 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -43,6 +43,19 @@ class Homesick < Thor git_submodule_update end end + + homesickrc = destination.join('.homesickrc').expand_path + if homesickrc.exist? + proceed = shell.yes?("#{uri} has a .homesickrc. Proceed with evaling it? (This could be destructive)") + if proceed + shell.say_status "eval", homesickrc + inside destination do + eval homesickrc.read, binding, homesickrc.expand_path + end + else + shell.say_status "eval skip", "not evaling #{homesickrc}, #{destination} may need manual configuration", :blue + end + end end end