Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/git-blog/workflow.rb
Overview
Test if a (String) path is a repo
Instance Method Summary collapse
Instance Method Details
#repo? ⇒ Boolean
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/git-blog/workflow.rb', line 8 def repo? ret = false # Use git rev-parse command to test if a directory is a repo full_path = File. self if File.directory? full_path Dir.chdir full_path do system "git rev-parse --show-toplevel > /dev/null 2>&1" ret = $?.exitstatus == 0 end end ret end |