Created
February 6, 2013 14:41
-
-
Save pedronsouza/4722937 to your computer and use it in GitHub Desktop.
A little rake task for automate my routine of Commit all
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :git do | |
task :sent, :message, :repo do |t, args| | |
if args[:message].nil? | |
puts "You must define a message for the commit, example => rake git:commit['MyMessage']".colored.red | |
else | |
puts "Adding files, Commiting and pushing..".colored.yellow | |
exec("git add . && git add -u && git commit -m '#{args[:message]}' && git push #{args[:repo]}") | |
puts "All files sent to remote repository: #{:repo}".colored.green | |
end | |
end | |
end | |
# usage: rake git:sent['message', 'remote'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment