mirror of
https://github.com/joaotavora/yasnippet.git
synced 2026-02-04 06:32:24 +00:00
rake doc:upload: check for wrong/incomplete rev
This commit is contained in:
11
Rakefile
11
Rakefile
@@ -67,7 +67,16 @@ namespace :doc do
|
||||
Dir.glob("doc/images/*").each do |file|
|
||||
FileUtils.cp file, 'doc/gh-pages/images'
|
||||
end
|
||||
rev = `git rev-parse --verify HEAD`
|
||||
curRev = `git rev-parse --verify HEAD`.chomp()
|
||||
expRev = IO.read('doc/html-revision').chomp()
|
||||
if curRev != expRev
|
||||
raise ("The HTML rev: #{expRev},\n" +
|
||||
"current rev: #{curRev}!\n")
|
||||
end
|
||||
if !system "git diff-index --quiet HEAD"
|
||||
system "git status --untracked-files=no"
|
||||
raise "You have uncommitted changes!"
|
||||
end
|
||||
Dir.chdir 'doc/gh-pages' do
|
||||
sh "git commit -a -m 'Automatic documentation update.\n\n" +
|
||||
"From #{rev.chomp()}'"
|
||||
|
||||
Reference in New Issue
Block a user