Skip to content
This repository
Browse code

Rakefile: Build on systems without Git.

We use the Git commit log to find the date a recipe was published. When
building on another system, such as Launchpad, we aren't working in a
repository so can't call `git log`. In this case we just issue a warning.
  • Loading branch information...
commit 5cbe7e40fe7e75b7ed852aaebff25b07efd0bf71 1 parent d1f8dff
runpaint authored

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 Rakefile
7 Rakefile
@@ -52,8 +52,13 @@ task :sitemap_notify do
52 52 end
53 53
54 54 def commit_time(file)
55   - Time.at(`git log -r --name-only --no-color --pretty=raw -z #{file}`.
  55 + begin
  56 + Time.at(`git log -r --name-only --no-color --pretty=raw -z #{file}`.
56 57 to_a.grep(/^committer/).last.match(/ (\d+) /)[1].to_i)
  58 + rescue
  59 + $stderr.puts "Couldn't get commit time for #{file}"
  60 + Time.now
  61 + end
57 62 end
58 63
59 64 def make_toc

0 comments on commit 5cbe7e4

Please sign in to comment.
Something went wrong with that request. Please try again.