Permalink
Browse files

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...
1 parent d1f8dff commit 5cbe7e40fe7e75b7ed852aaebff25b07efd0bf71 @runpaint committed May 24, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 Rakefile
View
7 Rakefile
@@ -52,8 +52,13 @@ task :sitemap_notify do
end
def commit_time(file)
- Time.at(`git log -r --name-only --no-color --pretty=raw -z #{file}`.
+ begin
+ Time.at(`git log -r --name-only --no-color --pretty=raw -z #{file}`.
to_a.grep(/^committer/).last.match(/ (\d+) /)[1].to_i)
+ rescue
+ $stderr.puts "Couldn't get commit time for #{file}"
+ Time.now
+ end
end
def make_toc

0 comments on commit 5cbe7e4

Please sign in to comment.