Skip to content

Instantly share code, notes, and snippets.

@redroot
Created May 14, 2014 09:41
Show Gist options
  • Select an option

  • Save redroot/60f376ece87314a5299a to your computer and use it in GitHub Desktop.

Select an option

Save redroot/60f376ece87314a5299a to your computer and use it in GitHub Desktop.
namespace :update do
task :services do
REPOS.each do |repo_path|
uncommitted_files = `cd #{repo_path} && git status --porcelain | wc -l`.strip.chomp.to_i
if uncommitted_files == 0
puts "Updating #{repo_path} ..."
puts `cd #{repo_path} && BUNDLE_GEMFILE=#{repo_path}/Gemfile bundle update config-gem`
puts `cd #{repo_path} && git commit -a -m "Updated config-gem"`
puts `cd #{repo_path} && git pull --rebase && git push`
else
puts "#{repo_path} has uncommitted files, skipping ..."
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment