Merge pull request #117 from JCook21/Shell

Merging as there doesn't seem to be any comments or issues with this.
This commit is contained in:
Jeremy Cook
2014-09-19 12:08:54 -04:00
3 changed files with 13 additions and 19 deletions

View File

@@ -1,5 +1,4 @@
# -*- encoding : utf-8 -*-
require 'homesick/shell'
require 'homesick/actions/file_actions'
require 'homesick/actions/git_actions'
require 'homesick/version'

View File

@@ -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'

View File

@@ -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