diff --git a/install-foundry-zksync b/install-foundry-zksync index 8d4e84070..cc9c5eff1 100755 --- a/install-foundry-zksync +++ b/install-foundry-zksync @@ -10,52 +10,49 @@ FOUNDRYUP_ZKSYNC_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksy echo "Downloading the install script..." curl -L "$INSTALL_SCRIPT_URL" -o install -# Make the install script executable echo "Making the install script executable..." chmod +x ./install -# Run the installation script and capture the output in a log file echo "Running the installation script..." -./install | tee install.log +./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) # Source the shell config file if available if [ -n "$SHELL_CONFIG_FILE" ]; then if [ -n "${CI}" ]; then FOUNDRY_BIN_DIR="${XDG_CONFIG_HOME:-$HOME}/.foundry/bin" - echo "Adding '${FOUNDRY_BIN_DIR}' to PATH and GITHUB_PATH" + echo "adding '${FOUNDRY_BIN_DIR}' to PATH and GITHUB_PATH" export PATH="$PATH:$FOUNDRY_BIN_DIR" echo "${FOUNDRY_BIN_DIR}" >> $GITHUB_PATH else echo "Sourcing the shell configuration file: '$SHELL_CONFIG_FILE'" + # Use dot (.) to source the file, which is more universally compatible . "$SHELL_CONFIG_FILE" fi else echo "No shell configuration file detected. Please source your shell manually or start a new terminal session." fi -# Download the foundryup-zksync script echo "Downloading foundryup-zksync..." curl -L "$FOUNDRYUP_ZKSYNC_URL" -o foundryup-zksync -# Make foundryup-zksync script executable -echo "Making foundryup-zksync executable............" +echo "Making foundryup-zksync executable..." chmod +x ./foundryup-zksync -# Run foundryup-zksync setup echo "Running foundryup-zksync setup..." ./foundryup-zksync # Cleanup: remove install and install.log +# Keeps foundryup-zksync for ease of use echo "Cleaning up installation artifacts..." rm -f ./install ./install.log echo "Cleanup completed." echo "Installation completed successfully!" -# Verify installation echo "Verifying installation..." if forge --version | grep -q "0.0.2"; then echo "Forge version 0.0.2 is successfully installed."