mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
rake doc:upload: check for wrong/incomplete rev
This commit is contained in:
parent
7d4e4aa34c
commit
7518cb4621
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
authors.txt
|
authors.txt
|
||||||
doc/gh-pages
|
doc/gh-pages
|
||||||
doc/*.html
|
doc/*.html
|
||||||
|
doc/html-revision
|
||||||
pkg/
|
pkg/
|
||||||
extras/imported/**
|
extras/imported/**
|
||||||
!extras/imported/*/.yas-setup.el
|
!extras/imported/*/.yas-setup.el
|
||||||
|
11
Rakefile
11
Rakefile
@ -67,7 +67,16 @@ namespace :doc do
|
|||||||
Dir.glob("doc/images/*").each do |file|
|
Dir.glob("doc/images/*").each do |file|
|
||||||
FileUtils.cp file, 'doc/gh-pages/images'
|
FileUtils.cp file, 'doc/gh-pages/images'
|
||||||
end
|
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
|
Dir.chdir 'doc/gh-pages' do
|
||||||
sh "git commit -a -m 'Automatic documentation update.\n\n" +
|
sh "git commit -a -m 'Automatic documentation update.\n\n" +
|
||||||
"From #{rev.chomp()}'"
|
"From #{rev.chomp()}'"
|
||||||
|
@ -114,13 +114,13 @@
|
|||||||
;; This lets all the org files be exported to HTML with
|
;; This lets all the org files be exported to HTML with
|
||||||
;; `org-publish-current-project' (C-c C-e P).
|
;; `org-publish-current-project' (C-c C-e P).
|
||||||
|
|
||||||
(let* ((rev (or (with-temp-buffer
|
(let* ((dir (if load-file-name (file-name-directory load-file-name)
|
||||||
(when (eq (call-process "git" nil t nil
|
|
||||||
"rev-parse" "--verify" "HEAD") 0)
|
|
||||||
(buffer-string)))
|
|
||||||
yas--version))
|
|
||||||
(dir (if load-file-name (file-name-directory load-file-name)
|
|
||||||
default-directory))
|
default-directory))
|
||||||
|
(rev (with-temp-file (expand-file-name "html-revision" dir)
|
||||||
|
(or (when (eq (call-process "git" nil t nil
|
||||||
|
"rev-parse" "--verify" "HEAD") 0)
|
||||||
|
(buffer-string))
|
||||||
|
(princ yas--version (current-buffer)))))
|
||||||
(proj-plist
|
(proj-plist
|
||||||
(list
|
(list
|
||||||
:base-directory dir :publishing-directory dir
|
:base-directory dir :publishing-directory dir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user