You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.2 KiB

  1. #! /bin/bash
  2. set -e
  3. # NOTE: go-alert depends on go-common
  4. REPOS=("autofile" "clist" "db" "events" "flowrate" "logger" "process")
  5. mkdir common
  6. git mv *.go common
  7. git mv LICENSE common
  8. git commit -m "move all files to common/ to begin repo merge"
  9. for repo in "${REPOS[@]}"; do
  10. # add and fetch the repo
  11. git remote add -f "$repo" "https://github.com/tendermint/go-${repo}"
  12. # merge master and move into subdir
  13. git merge "$repo/master" --no-edit
  14. if [[ "$repo" != "flowrate" ]]; then
  15. mkdir "$repo"
  16. git mv *.go "$repo/"
  17. fi
  18. set +e # these might not exist
  19. git mv *.md "$repo/"
  20. git mv README "$repo/README.md"
  21. git mv Makefile "$repo/Makefile"
  22. git rm LICENSE
  23. set -e
  24. # commit
  25. git commit -m "merge go-${repo}"
  26. git remote rm "$repo"
  27. done
  28. go get github.com/ebuchman/got
  29. got replace "tendermint/go-common" "tendermint/go-common/common"
  30. for repo in "${REPOS[@]}"; do
  31. if [[ "$repo" != "flowrate" ]]; then
  32. got replace "tendermint/go-${repo}" "tendermint/go-common/${repo}"
  33. else
  34. got replace "tendermint/go-${repo}/flowrate" "tendermint/go-common/flowrate"
  35. fi
  36. done
  37. git add -u
  38. git commit -m "update import paths"
  39. # TODO: change any paths in non-Go files
  40. # TODO: add license