Rename content to source
It is a instance of Pathname, not binary content
This commit is contained in:
@@ -27,13 +27,13 @@ module Homesick
|
|||||||
# Hack in support for diffing symlinks
|
# Hack in support for diffing symlinks
|
||||||
# Also adds support for checking if destination or content is a directory
|
# Also adds support for checking if destination or content is a directory
|
||||||
shell_metaclass = class << shell; self; end
|
shell_metaclass = class << shell; self; end
|
||||||
shell_metaclass.send(:define_method, :show_diff) do |destination, content|
|
shell_metaclass.send(:define_method, :show_diff) do |destination, source|
|
||||||
destination = Pathname.new(destination)
|
destination = Pathname.new(destination)
|
||||||
content = Pathname.new(content)
|
source = Pathname.new(source)
|
||||||
return 'Unable to create diff: destination or content is a directory' if destination.directory? || content.directory?
|
return 'Unable to create diff: destination or content is a directory' if destination.directory? || source.directory?
|
||||||
return super(destination, content) unless destination.symlink?
|
return super(destination, source) unless destination.symlink?
|
||||||
say "- #{destination.readlink}", :red, true
|
say "- #{destination.readlink}", :red, true
|
||||||
say "+ #{content.expand_path}", :green, true
|
say "+ #{source.expand_path}", :green, true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user