File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,23 @@ task :compile do
55 `nanoc compile`
66end
77
8+ # prompt user for a commit message; default: HEAD commit 1-liner
9+ def commit_message
10+ last_commit = `git log -1 --pretty=format:"%s"` . chomp . strip
11+ last_commit = 'Publishing developer content to GitHub pages.' if last_commit == ''
12+
13+ print "Enter a commit message (default: '#{ last_commit } '): "
14+ STDOUT . flush
15+ mesg = STDIN . gets . chomp . strip
16+
17+ mesg = last_commit if mesg == ''
18+ mesg . gsub ( /'/ , '' ) # to allow this to be handed off via -m '#{message}'
19+ end
20+
821desc "Publish to http://developer.github.com"
922task :publish => [ :clean ] do
23+ mesg = commit_message
24+
1025 FileUtils . rm_r ( 'output' ) if File . exist? ( 'output' )
1126
1227 sh "nanoc compile"
@@ -21,9 +36,9 @@ task :publish => [:clean] do
2136 tsha = `git write-tree` . strip
2237 puts "Created tree #{ tsha } "
2338 if old_sha . size == 40
24- csha = `echo 'boom' | git commit-tree #{ tsha } -p #{ old_sha } ` . strip
39+ csha = `git commit-tree #{ tsha } -p #{ old_sha } -m ' #{ mesg } ' ` . strip
2540 else
26- csha = `echo 'boom' | git commit-tree #{ tsha } ` . strip
41+ csha = `git commit-tree #{ tsha } -m ' #{ mesg } ' ` . strip
2742 end
2843 puts "Created commit #{ csha } "
2944 puts `git show #{ csha } --stat`
Original file line number Diff line number Diff line change 2020Check out the docs for sorting and filtering options:
2121
2222* [Organization Repositories](/v3/repos/#list-organization-repositories)
23+
You can’t perform that action at this time.
0 commit comments