diff --git a/lib/homesick.rb b/lib/homesick.rb index 9af78eb..7fe7842 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -53,13 +53,21 @@ class Homesick < Thor end end + rc(destination) + end + end + + desc 'rc CASTLE', 'Run the .homesickrc for the specified castle' + def rc(name = DEFAULT_CASTLE_NAME) + inside repos_dir do + destination = Pathname.new(name) homesickrc = destination.join('.homesickrc').expand_path if homesickrc.exist? - proceed = shell.yes?("#{uri} has a .homesickrc. Proceed with evaling it? (This could be destructive)") + proceed = shell.yes?("#{name} 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 + eval homesickrc.read, binding, homesickrc.expand_path.to_s end else shell.say_status 'eval skip', "not evaling #{homesickrc}, #{destination} may need manual configuration", :blue