-1

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?

DanielST
  • 13,783
  • 7
  • 42
  • 65
huynhthinh
  • 37
  • 5

1 Answers1

0

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

anonymous
  • 1,522
  • 14
  • 24