gokdok 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/gokdok.rb +7 -0
  2. metadata +1 -1
@@ -52,6 +52,11 @@ module Gokdok
52
52
 
53
53
  private
54
54
 
55
+ # Fix git variables that may have been set by other tasks
56
+ def clear_git_vars
57
+ %w(GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE).each { |var| ENV[var] = nil }
58
+ end
59
+
55
60
  def find_git_binary
56
61
  `which git`.chop
57
62
  end
@@ -110,6 +115,7 @@ module Gokdok
110
115
  end
111
116
 
112
117
  def run_git_command(command)
118
+ clear_git_vars
113
119
  result = system("#{git_path} #{command}")
114
120
  raise(RuntimeError, "Could not run: git #{command}") unless(result)
115
121
  end
@@ -131,6 +137,7 @@ module Gokdok
131
137
 
132
138
  desc 'Create the documentation without actually pushing it'
133
139
  task :update => rdoc_task do
140
+ clear_git_vars
134
141
  repo = Grit::Repo.new(pages_home)
135
142
  remote_dir = File.join(pages_home, remote_path)
136
143
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gokdok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Hahn