Added simple implementation to check if git is installed before

executing commands.
This commit is contained in:
Jeremy Cook
2014-11-08 13:28:22 -05:00
parent 63c45d7c3a
commit b7e2b45e69
2 changed files with 18 additions and 2 deletions

View File

@@ -19,8 +19,13 @@ module Homesick
def initialize(args = [], options = {}, config = {})
super
self.shell = Thor::Shell::Color.new
# Check if git is installed
unless `git --version`.size > 0
say_status :error, 'Git must be installed to use Homesick', :red
exit(1)
end
# Hack in support for diffing symlinks
self.shell = Thor::Shell::Color.new
class << shell
def show_diff(destination, content)
destination = Pathname.new(destination)