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:
@@ -1,5 +1,4 @@
|
|||||||
# -*- encoding : utf-8 -*-
|
# -*- encoding : utf-8 -*-
|
||||||
require 'homesick/shell'
|
|
||||||
require 'homesick/actions/file_actions'
|
require 'homesick/actions/file_actions'
|
||||||
require 'homesick/actions/git_actions'
|
require 'homesick/actions/git_actions'
|
||||||
require 'homesick/version'
|
require 'homesick/version'
|
||||||
|
|||||||
@@ -19,7 +19,19 @@ module Homesick
|
|||||||
|
|
||||||
def initialize(args = [], options = {}, config = {})
|
def initialize(args = [], options = {}, config = {})
|
||||||
super
|
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
|
end
|
||||||
|
|
||||||
desc 'clone URI', 'Clone +uri+ as a castle for homesick'
|
desc 'clone URI', 'Clone +uri+ as a castle for homesick'
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user