forked from tendermint/tmlibs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmerge.sh
54 lines (40 loc) · 1.19 KB
/
merge.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash
set -e
# NOTE: go-alert depends on go-common
REPOS=("autofile" "clist" "db" "events" "flowrate" "logger" "process")
mkdir common
git mv *.go common
git mv LICENSE common
git commit -m "move all files to common/ to begin repo merge"
for repo in "${REPOS[@]}"; do
# add and fetch the repo
git remote add -f "$repo" "https://github.com/tendermint/go-${repo}"
# merge master and move into subdir
git merge "$repo/master" --no-edit
if [[ "$repo" != "flowrate" ]]; then
mkdir "$repo"
git mv *.go "$repo/"
fi
set +e # these might not exist
git mv *.md "$repo/"
git mv README "$repo/README.md"
git mv Makefile "$repo/Makefile"
git rm LICENSE
set -e
# commit
git commit -m "merge go-${repo}"
git remote rm "$repo"
done
go get github.com/ebuchman/got
got replace "tendermint/go-common" "tendermint/go-common/common"
for repo in "${REPOS[@]}"; do
if [[ "$repo" != "flowrate" ]]; then
got replace "tendermint/go-${repo}" "tendermint/go-common/${repo}"
else
got replace "tendermint/go-${repo}/flowrate" "tendermint/go-common/flowrate"
fi
done
git add -u
git commit -m "update import paths"
# TODO: change any paths in non-Go files
# TODO: add license