Skip to content

Commit 51ef10a

Browse files
committed
Publish colourfully by default.
1 parent 84252a2 commit 51ef10a

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Rakefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ task :compile do
55
`nanoc compile`
66
end
77

8-
# prompt user for a commit message; default: HEAD commit 1-liner
8+
# Prompt user for a commit message; default: P U B L I S H :emoji:
99
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 == ''
10+
publish_emojis = [':boom:', ':rocket:', ':metal:', ':bulb:', ':zap:',
11+
':sailboat:', ':gift:', ':ship:', ':shipit:', ':sparkles:', ':rainbow:']
12+
default_message = "P U B L I S H #{publish_emojis.sample}"
1213

13-
print "Enter a commit message (default: '#{last_commit}'): "
14+
print "Enter a commit message (default: '#{default_message}'): "
1415
STDOUT.flush
1516
mesg = STDIN.gets.chomp.strip
1617

17-
mesg = last_commit if mesg == ''
18-
mesg.gsub(/'/, '') # to allow this to be handed off via -m '#{message}'
18+
mesg = default_message if mesg == ''
19+
mesg.gsub(/'/, '') # Allow this to be handed off via -m '#{message}'
1920
end
2021

2122
desc "Publish to http://developer.github.com"

0 commit comments

Comments
 (0)