Skip to content

Commit

Permalink
Do a git push, too
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Lavender committed Feb 26, 2014
1 parent 1f712c1 commit f7fea5b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ task :serve do
end

task :upload => :build do
current_branch = `git branch 2>/dev/null | awk '/^\* /{print $2}'`
sh "git checkout gh-pages"
sh "cp -R .html/.* ."
sh "git add ."
sh "git commit -m 'P U B L I S H'"
sh "git checkout #{current_branch}"
current_branch = `git branch 2>/dev/null | awk '/^\* /{print $2}'`.strip
["git checkout gh-pages",
"rsync -rv .html/.* .",
"git add .",
"[[ -z `git status --porcelain` ]] || (git commit -m 'P U B L I S H' ; git push -f)",
"git checkout #{current_branch}"].all? do |cmd|
# We use all? so that we'll abort if anything fails.
sh cmd, verbose: true
end
end

0 comments on commit f7fea5b

Please sign in to comment.