File tree 3 files changed +30
-5
lines changed
3 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 1
1
require 'script/merge'
2
2
require 'script/html'
3
3
require 'script/pdf'
4
- require 'script/prince'
4
+ require 'script/prince'
5
+ require 'script/publish'
Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ <h3>The Git Community Book</h3>
59
59
< div id ="download ">
60
60
< h3 > Download</ h3 >
61
61
< div class ="inner ">
62
- Click < a href ="book.pdf "> here</ a > to download the current PDF version of this book.
62
+ Click < a href ="https://github.s3.amazonaws.com/media/ book.pdf "> here</ a > to download the current PDF version of this book.
63
63
< hr />
64
- < a href ="book.pdf "> < img height ="50 " border ="0 " src ="assets/images/pdf.png "/> </ a >
64
+ < a href ="https://github.s3.amazonaws.com/media/ book.pdf "> < img height ="50 " border ="0 " src ="assets/images/pdf.png "/> </ a >
65
65
</ div >
66
66
</ div >
67
67
</ div >
@@ -115,8 +115,6 @@ <h3>New to Git?</h3>
115
115
pageTracker . _initData ( ) ;
116
116
pageTracker . _trackPageview ( ) ;
117
117
</ script >
118
- < script src ="http://static.getclicky.com/40584.js " type ="text/javascript "> </ script >
119
- < noscript > < p > < img alt ="Clicky " src ="http://in.getclicky.com/40584-db6.gif " /> </ p > </ noscript >
120
118
121
119
</ body >
122
120
</ html >
Original file line number Diff line number Diff line change
1
+ task :publish do
2
+ File . open ( "output/CNAME" , 'w+' ) do |f |
3
+ f . puts ( "book.git-scm.com" )
4
+ end
5
+
6
+ ENV [ 'GIT_DIR' ] = File . expand_path ( `git rev-parse --git-dir` . chomp )
7
+ old_sha = `git rev-parse refs/remotes/origin/gh-pages` . chomp
8
+ Dir . chdir ( 'output/book' ) do
9
+ ENV [ 'GIT_INDEX_FILE' ] = gif = '/tmp/dev.gb.i'
10
+ ENV [ 'GIT_WORK_TREE' ] = Dir . pwd
11
+ File . unlink ( gif ) if File . file? ( gif )
12
+ `git add -A`
13
+ tsha = `git write-tree` . strip
14
+ puts "Created tree #{ tsha } "
15
+ if old_sha . size == 40
16
+ csha = `echo 'boom' | git commit-tree #{ tsha } -p #{ old_sha } ` . strip
17
+ else
18
+ csha = `echo 'boom' | git commit-tree #{ tsha } ` . strip
19
+ end
20
+ puts "Created commit #{ csha } "
21
+ puts `git show #{ csha } --stat`
22
+ puts "Updating gh-pages from #{ old_sha } "
23
+ `git update-ref refs/heads/gh-pages #{ csha } `
24
+ `git push origin gh-pages`
25
+ end
26
+ end
You can’t perform that action at this time.
0 commit comments