I have a yml
file in my local project, stored in config/locales/en.yml
.
I want to create rake task to push this file to GitHub, overwriting the existing file.
How can I accomplish this?
I have a yml
file in my local project, stored in config/locales/en.yml
.
I want to create rake task to push this file to GitHub, overwriting the existing file.
How can I accomplish this?
Perhaps you want something like this?
# in lib/tasks/github.rake
namespace :github do
desc "Push locale stored in `config/locales/en.yml` to github"
task :push_locale do |t|
sh "git add config/locales/en.yml"
sh "git commit -m 'Update locale.'"
sh "git push"
end
end
and then invoke the task with rake github:push_locale