roll_it.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. # Do something that somewhat resembles a roll of closure-library.
  3. die() {
  4. echo $* >&2
  5. exit 1
  6. }
  7. prompt() {
  8. echo $*
  9. echo press enter to continue, or interrupt.
  10. read ignored
  11. }
  12. CHROMIUM=`pwd`
  13. prompt using $CHROMIUM as closure-library.
  14. # TODO: remove $CHROMIUM/everything except our own files
  15. CLOSURE=/tmp/closure
  16. mkdir $CLOSURE || die cannot make $CLOSURE does it already exist?
  17. cd $CLOSURE || die cannot cd to $CLOSURE after making it. that is really unexpected. good luck.
  18. git clone "https://github.com/google/closure-library.git" || die cannot clone upstream repo
  19. cd closure-library || die cannot cd to closure-library after cloning it. did they rename it?
  20. CLOSURE_VERSION=`cat package.json |grep version |head -1 |sed 's/^.*": "//' |sed 's/".*//'`
  21. prompt version is ${CLOSURE_VERSION}. hopefully this looks sane to you.
  22. SHA1=`git log --format=%H -1`
  23. prompt sha1 of head is ${SHA1}. hopefully this looks sane to you.
  24. tar cvf - . |(cd $CHROMIUM && tar xvf - ) || die cannot tar. or untar. or maybe cd. im a script, not a door.
  25. cd $CHROMIUM || die cannot cd to $CHROMIUM after copying new library
  26. # I was going to do this automatically, but ran out of time.
  27. die Please update readme file.
  28. prompt about to add and upload. press enter if okay, or interrupt if not.
  29. # This will add new files too.
  30. git add --all .
  31. git commit -m "Rolled closure-libary"
  32. git cl upload
  33. git cl try
  34. echo Congratulations. Now land it.
  35. echo if the trybots fail with unknon deps, then add them to:
  36. echo //third_party/protobuf/BUILD.gn
  37. exit 0