From 3bc623be7c3203610cca75516f982af4b017ae2b Mon Sep 17 00:00:00 2001 From: Jason Buckner Date: Sat, 24 Nov 2012 23:56:12 -0800 Subject: [PATCH] perform a git add when doing a homesick track --- lib/homesick.rb | 4 ++++ lib/homesick/actions.rb | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lib/homesick.rb b/lib/homesick.rb index 634ea98..06a6210 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -125,6 +125,10 @@ class Homesick < Thor home_path = home_dir + file ln_s absolute_path, home_path end + + inside castle_path do + git_add absolute_path + end end desc "list", "List cloned castles" diff --git a/lib/homesick/actions.rb b/lib/homesick/actions.rb index 998c696..d5c0cfe 100644 --- a/lib/homesick/actions.rb +++ b/lib/homesick/actions.rb @@ -70,6 +70,11 @@ class Homesick system "git commit -v -a" unless options[:pretend] end + def git_add(file, config = {}) + say_status 'git add file', '', :green unless options[:quiet] + system "git add #{file}" unless options[:pretend] + end + def mv(source, destination, config = {}) source = Pathname.new(source) destination = Pathname.new(destination + source.basename)