Skip to content

Commit

Permalink
checks if docs dir exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Gonzalez committed Feb 15, 2012
1 parent 1fc05c3 commit 64a3846
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Rakefile
Expand Up @@ -37,7 +37,7 @@ end

# Updates GITHUB PAGES
desc 'Update gh-pages branch'
task 'docs:pages' => ['docs/.git', :docs] do
task 'docs:pages' => ['docs/', 'docs/.git', :docs] do
rev = `git rev-parse --short HEAD`.strip
Dir.chdir 'docs' do
last_commit = `git log -n1 --pretty=oneline`.strip
Expand All @@ -60,6 +60,10 @@ task 'docs:pages' => ['docs/.git', :docs] do
end
end

file 'docs/' do |f|
Dir.mkdir(f.name) if !File.exists?(f.name)
end

# Update the pages/ directory clone
file 'docs/.git' => ['docs/', '.git/refs/heads/gh-pages'] do |f|
sh "cd docs && git init -q && git remote add origin git@github.com:spire-io/spire.io.rb.git" if !File.exist?(f.name)
Expand Down

0 comments on commit 64a3846

Please sign in to comment.