-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathsetup_vendor.sh
More file actions
executable file
·41 lines (31 loc) · 983 Bytes
/
setup_vendor.sh
File metadata and controls
executable file
·41 lines (31 loc) · 983 Bytes
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
#!/bin/bash
# setup vendor script
set -e
if [ -f "$(dirname "$0")/ETH.cfg" ]; then
MODULE_NAME="bls-eth-go-binary"
echo "github.com/herumi/${MODULE_NAME}"
else
MODULE_NAME="bls-go-binary"
echo "ETH.cfg not found, using module: github.com/herumi/${MODULE_NAME}"
fi
MODULE="github.com/herumi/${MODULE_NAME}"
echo "module : ${MODULE_NAME}"
if [ $# -ge 1 ]; then
VERSION="$1"
echo "Using specified version: ${VERSION}"
else
VERSION=$(go list -m -f '{{.Version}}' ${MODULE})
fi
if [ -z "$VERSION" ]; then
echo "Error: Could not determine module version. Please add the module to go.mod or specify version as argument."
echo "Usage: $0 [version]"
echo "Example: $0 v1.36.4"
exit 1
fi
GOPATH=$(go env GOPATH)
MODULE_PATH="${GOPATH}/pkg/mod/${MODULE}@${VERSION}"
go mod vendor
mkdir -p vendor/${MODULE}/bls/include
mkdir -p vendor/${MODULE}/bls/lib/
cp -r "${MODULE_PATH}/bls/include/" "vendor/${MODULE}/bls/"
cp -r "${MODULE_PATH}/bls/lib/" "vendor/${MODULE}/bls/"