Skip to content

Instantly share code, notes, and snippets.

@mdarby
Created September 4, 2009 22:29
Show Gist options
  • Select an option

  • Save mdarby/181192 to your computer and use it in GitHub Desktop.

Select an option

Save mdarby/181192 to your computer and use it in GitHub Desktop.

Revisions

  1. mdarby created this gist Sep 4, 2009.
    16 changes: 16 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    before "deploy", "deploy:check_revision"

    namespace :deploy do
    desc "Make sure there is something to deploy"
    task :check_revision, :roles => [:web] do
    unless `git rev-parse HEAD` == `git rev-parse origin/master`
    puts ""
    puts " \033[1;33m**************************************************\033[0m"
    puts " \033[1;33m* WARNING: HEAD is not the same as origin/master *\033[0m"
    puts " \033[1;33m**************************************************\033[0m"
    puts ""

    exit
    end
    end
    end