Class: YJCocoa::Git

Inherits:
Command
  • Object
show all
Defined in:
lib/yjcocoa/git/git.rb

Overview

Usage

Direct Known Subclasses

GitBranch, GitCache, GitCheckout, GitPull, GitTag

Constant Summary

Constants inherited from Command

Command::DEFAULT_OPTIONS

Instance Method Summary collapse

Methods inherited from Command

#askWithAnswers, options

Instance Method Details

#gitExist?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
30
31
32
# File 'lib/yjcocoa/git/git.rb', line 22

def gitExist?
    if File.exist?(".git")
        return true
    elsif Dir.pwd == "/"
        puts "fatal: Not a git repository (or any of the parent directories): .git".red
        return false
    end
    Dir.chdir("..") {
        return self.gitExist?
    }
end