diff --git a/lib/homesick.rb b/lib/homesick.rb index bd7d6cb..1e32c91 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -1,5 +1,4 @@ # -*- encoding : utf-8 -*- -require 'homesick/shell' require 'homesick/actions/file_actions' require 'homesick/actions/git_actions' require 'homesick/version' diff --git a/lib/homesick/cli.rb b/lib/homesick/cli.rb index ac2afb4..fdb5fba 100644 --- a/lib/homesick/cli.rb +++ b/lib/homesick/cli.rb @@ -19,7 +19,19 @@ module Homesick def initialize(args = [], options = {}, config = {}) super - self.shell = Homesick::Shell.new + self.shell = Thor::Shell::Color.new + # Hack in support for diffing symlinks + class << shell + def show_diff(destination, content) + destination = Pathname.new(destination) + if destination.symlink? + say "- #{destination.readlink}", :red, true + say "+ #{content.expand_path}", :green, true + else + super + end + end + end end desc 'clone URI', 'Clone +uri+ as a castle for homesick' diff --git a/lib/homesick/shell.rb b/lib/homesick/shell.rb deleted file mode 100644 index d53dbda..0000000 --- a/lib/homesick/shell.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'thor' - -module Homesick - # Hack in support for diffing symlinks - class Shell < Thor::Shell::Color - def show_diff(destination, content) - destination = Pathname.new(destination) - - if destination.symlink? - say "- #{destination.readlink}", :red, true - say "+ #{content.expand_path}", :green, true - else - super - end - end - end -end