lib/timber/cli/os_helper.rb in timber-2.1.4 vs lib/timber/cli/os_helper.rb in timber-2.1.5
- old
+ new
@@ -12,19 +12,27 @@
true
rescue Exception
false
end
+ def self.git_clean_working_tree?
+ `git diff-index --quiet HEAD -- || echo "untracked";` == ""
+ end
+
def self.git_commit_changes
begin
`git add config/initializers/timber.rb`
rescue Exception
end
`git commit -am 'Install the timber logger'`
true
rescue Exception
false
+ end
+
+ def self.git_master?
+ `git rev-parse --abbrev-ref HEAD` == "master"
end
def self.has_git?
begin
`which git` != ""
\ No newline at end of file