forked from matter-labs/foundry-zksync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-foundry-zksync
executable file
·34 lines (26 loc) · 1.07 KB
/
install-foundry-zksync
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
#!/bin/bash
set -e
echo "Navigating to the foundryup-zksync script..."
cd foundryup-zksync
echo "Making install script executable..."
chmod +x ./install
echo "Running the installation script..."
./install | tee install.log # Capture the output to both stdout and a log file
# Extract the exact path from the install.log
# Use sed to precisely capture the path after 'source' and before the next apostrophe
SHELL_CONFIG_FILE=$(sed -n "s/.*Run 'source \(.*\)'.*/\1/p" install.log)
if [ -n "$SHELL_CONFIG_FILE" ]; then
echo "Sourcing the shell configuration file: $SHELL_CONFIG_FILE"
# Use dot (.) to source the file, which is more universally compatible
. "$SHELL_CONFIG_FILE"
else
echo "No shell configuration file detected. Please source your shell manually or start a new terminal session."
fi
echo "Running foundryup-zksync setup..."
./foundryup-zksync
echo "Verifying installation..."
if forge --version | grep -q "0.0.2"; then
echo "Forge version 0.0.2 is successfully installed."
else
echo "Installation verification failed. Forge is not properly installed."
fi