-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdateTuweni.sh
executable file
·46 lines (36 loc) · 1.08 KB
/
updateTuweni.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
#!/bin/bash
set -euo pipefail
TEMP=`mktemp -d`
function cleanup() {
rm -rf "${TEMP}"
}
trap cleanup EXIT
VERSION=${1?Must specify the tuweni version to get}
URL="https://downloads.apache.org/incubator/tuweni/${VERSION}-incubating/tuweni-bin-${VERSION}-incubating.zip"
echo "Downloading version ${VERSION} of tuweni from ${URL}..."
curl -o "${TEMP}/tuweni-${VERSION}.zip" -L --fail "${URL}"
unzip -t "${TEMP}/tuweni-${VERSION}.zip"
echo "Calculating new hash..."
HASH=`shasum -a 256 ${TEMP}/tuweni-${VERSION}.zip | cut -d ' ' -f 1`
cat > tuweni.rb <<EOF
class Tuweni < Formula
desc "apache tuweni ethereum client"
homepage "https://github.com/apache/incubator-tuweni"
url "${URL}"
# update with: ./updateTuweni.sh <new-version>
sha256 "${HASH}"
depends_on "openjdk" => "11+"
def install
prefix.install "lib"
bin.install "bin/tuweni"
# bin.install "bin/jsonrpc"
bin.install "bin/eth-faucet"
end
test do
system "#{bin}/tuweni" "--help"
end
end
EOF
echo "New url: ${URL}"
echo "New hash: ${HASH}"
echo "Success. Commit the changes to tuweni.rb to release."