metadata-update-and-push.js 931 B

123456789101112131415161718192021222324252627282930
  1. import update_metadata from './modules/update-metadata.js'
  2. import commit from './modules/commit.js'
  3. import exec from './modules/exec.js'
  4. if (update_metadata())
  5. {
  6. commit()
  7. console.log()
  8. console.log('========================================')
  9. console.log('= Pushing changes =')
  10. console.log('========================================')
  11. console.log()
  12. // Delete previous `update-metadata` remote branch
  13. // (if it already exists)
  14. if (exec('git ls-remote --heads origin update-metadata'))
  15. {
  16. console.log(exec('git push origin update-metadata --delete'))
  17. }
  18. // Push the local `update-metadata` branch to GitHub
  19. console.log(exec('git push origin update-metadata'))
  20. console.log()
  21. console.log('==========================================')
  22. console.log('= Pushed. Create Pull Request on GitHub. =')
  23. console.log('==========================================')
  24. console.log()
  25. }