forked from ProvableHQ/workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·80 lines (60 loc) · 1.67 KB
/
install.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
echo "
Starting installation...
"
if [[ $OSTYPE == 'darwin'* ]]; then
echo "Step 0: Install Command Line Developer Tools"
# Install macOS Command Line Tools
xcode-select --install > /dev/null 2>&1
if [ 0 == $? ]; then
sleep 1
osascript <<EOD
tell application "System Events"
tell process "Install Command Line Developer Tools"
keystroke return
click button "Agree" of window "License Agreement"
end tell
end tell
EOD
else
echo " Command Line Developer Tools are already installed!"
fi
fi
# Create the .build directory, if it does not already exist.
mkdir -p .build
# Enter the .build directory.
cd .build
echo "
Step 1: Fetching the Aleo and Leo Github repositories..."
# Clone the 'aleo' repository, or pull if it already exists.
git clone https://github.com/AleoHQ/aleo.git aleo 2> /dev/null || (cd aleo ; git pull)
# Clone the 'leo' repository, or pull if it already exists.
git clone https://github.com/AleoHQ/leo.git leo 2> /dev/null || (cd leo ; git pull)
echo "
Step 2: Installing Aleo..."
# Install 'aleo'.
cd aleo && cargo install --locked --path . && cd ..
echo "
Step 3: Installing Leo..."
# Install 'leo'.
cd leo && cargo install --locked --path . && cd ..
echo "
Step 4: Downloading parameters. This will take a few minutes...
"
# Create a new Leo project.
leo new install > /dev/null 2>&1
cd install
# Attempt to compile the program until it passes.
# This is necessary to ensure that the universal parameters are downloaded.
declare -i DONE
DONE=1
while [ $DONE -ne 0 ]
do
leo build 2>&1
DONE=$?
sleep 0.5
done
# Remove the program.
cd .. && rm -rf install
echo "
Installation complete. Open a new Terminal to begin.
"