-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·49 lines (33 loc) · 1.15 KB
/
build.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
#!/bin/bash
cat <<"EOF"
__ _ _ _
__ _____ _ __ __ _ / _(_)_ __ __ _ _ __ ___(_) __ _| |
\ \ / / _ \ '__/ _` | | |_| | '_ \ / _` | '_ \ / __| |/ _` | |
\ V / __/ | | (_| |_| _| | | | | (_| | | | | (__| | (_| | |
\_/ \___|_| \__,_(_)_| |_|_| |_|\__,_|_| |_|\___|_|\__,_|_|
EOF
echo This will take a while please be patient
if [ -n "( lsb_release -a | grep Ubuntu ) " ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
sudo apt update
sudo apt install -y git clang curl libssl-dev llvm libudev-dev
if [ -z "$(command -v rustc)" ]; then
curl https://getsubstrate.io -sSf | bash -s -- --fast
fi
source ~/.cargo/env
if [ "$(cargo-contract -V)" != "cargo-contract 0.8.0" ]; then
cargo install cargo-contract --vers ^0.8 --force --locked
fi
rustup component add rust-src --toolchain nightly
fi
if [ -n "$(command -v cargo)" ]; then
for d in */; do
(cd "$d" &&
if [ -f Cargo.toml ]; then
echo "Building ----> $d"
cargo +nightly contract build
fi)
done
else
echo "Please install rust and cargo."
fi