-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathdev.sh
82 lines (67 loc) · 1.8 KB
/
dev.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
artelamint_mod=./go.mod
artelasdk_mod=../aspect-core/go.mod
evm_mod=../artela-evm/go.mod
artela_aspect_mod=../artela-cosmos-sdk/go.mod
# add replacement to artelamint
update_artelamint_mod() {
cat >>$artelamint_mod <<EOF
replace (
github.com/artela-network/aspect-core => ../aspect-core
github.com/artela-network/artela-evm => ../artela-evm
github.com/artela-network/aspect-runtime => ../aspect-runtime
)
EOF
sed -i -e "s/\(github.com\/cosmos\/cosmos-sdk => \).*/\1..\/artela-cosmos-sdk/" $artelamint_mod
rm -f $artelamint_mod-e
}
# add replacement to artelasdk
update_artelasdk_mod() {
cat >>$artelasdk_mod <<EOF
replace (
github.com/artela-network/aspect-runtime => ../aspect-runtime
)
EOF
}
# add replacement to artela-aspect
update_artela_aspect_mod() {
cat >>$artela_aspect_mod <<EOF
replace (
github.com/artela-network/aspect-core => ../aspect-core
github.com/artela-network/aspect-runtime => ../aspect-runtime
)
EOF
sed -i -e "s/\(github.com\/tendermint\/tendermint => \).*/\1..\/cometbft/" $artela_aspect_mod
rm -f $artelamint_mod-e
}
# add replacement to evm
update_evm_mod() {
cat >>$evm_mod <<EOF
replace (
github.com/artela-network/aspect-core => ../aspect-core
github.com/artela-network/aspect-runtime => ../aspect-runtime
)
EOF
}
input=$1
if [ $input == "set" ]; then
echo "setting submodule ..."
update_artelamint_mod
update_artelasdk_mod
update_artela_aspect_mod
update_evm_mod
echo "done"
elif [ $input == "reset" ]; then
echo "resetting go.mod ..."
curdir=$(pwd)
git checkout go.mod
cd ../aspect-core
git checkout go.mod
cd ../artela-cosmos-sdk
git checkout go.mod
cd ../artela-evm
git checkout go.mod
echo "done"
else
echo "nothing has been changes, dev set|reset"
fi