From 91876d40177fd4f6b1ae94dd7938b82ce15e6829 Mon Sep 17 00:00:00 2001 From: thepluck Date: Wed, 9 Oct 2024 14:31:38 +0700 Subject: [PATCH] feat: Rename binaries at the end of installation --- foundryup-zksync/foundryup-zksync | 10 +++++++--- foundryup-zksync/install | 4 ++-- install-foundry-zksync | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/foundryup-zksync/foundryup-zksync b/foundryup-zksync/foundryup-zksync index abc726a50..8732dac82 100755 --- a/foundryup-zksync/foundryup-zksync +++ b/foundryup-zksync/foundryup-zksync @@ -2,7 +2,7 @@ set -eo pipefail BASE_DIR=${XDG_CONFIG_HOME:-$HOME} -FOUNDRY_DIR=${FOUNDRY_DIR:-"$BASE_DIR/.foundry"} +FOUNDRY_DIR=${FOUNDRY_DIR:-"$BASE_DIR/.foundry-zksync"} FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin" FOUNDRY_MAN_DIR="$FOUNDRY_DIR/share/man/man1" @@ -186,7 +186,7 @@ EOF FOUNDRYUP_BRANCH=${FOUNDRYUP_BRANCH:-main} REPO_PATH="$FOUNDRY_DIR/$FOUNDRYUP_REPO" - # If repo path does not exist, grab the author from the repo, make a directory in .foundry, cd to it and clone. + # If repo path does not exist, grab the author from the repo, make a directory in .foundry-zksync, cd to it and clone. if [ ! -d "$REPO_PATH" ]; then AUTHOR="$(echo "$FOUNDRYUP_REPO" | cut -d'/' -f1 -)" ensure mkdir -p "$FOUNDRY_DIR/$AUTHOR" @@ -205,7 +205,7 @@ EOF ensure git checkout "$FOUNDRYUP_COMMIT" fi - # Build the repo and install the binaries locally to the .foundry bin directory. + # Build the repo and install the binaries locally to the .foundry-zksync bin directory. ensure cargo build --bins "${CARGO_BUILD_ARGS[@]}" for bin in "${BINS[@]}"; do for try_path in target/release/$bin target/release/$bin.exe; do @@ -225,6 +225,10 @@ EOF say "done" fi + + for bin in "${BINS[@]}"; do + mv "$FOUNDRY_BIN_DIR/$bin" "$FOUNDRY_BIN_DIR/$bin-zksync" + done } usage() { diff --git a/foundryup-zksync/install b/foundryup-zksync/install index 8bf36687e..b7d1461b2 100755 --- a/foundryup-zksync/install +++ b/foundryup-zksync/install @@ -4,14 +4,14 @@ set -eo pipefail echo "Installing foundryup-zksync..." BASE_DIR="${XDG_CONFIG_HOME:-$HOME}" -FOUNDRY_DIR="${FOUNDRY_DIR-"$BASE_DIR/.foundry"}" +FOUNDRY_DIR="${FOUNDRY_DIR-"$BASE_DIR/.foundry-zksync"}" FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin" FOUNDRY_MAN_DIR="$FOUNDRY_DIR/share/man/man1" BIN_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/foundryup-zksync/foundryup-zksync" BIN_PATH="$FOUNDRY_BIN_DIR/foundryup-zksync" -# Create the .foundry bin directory and foundryup binary if it doesn't exist. +# Create the .foundry-zksync bin directory and foundryup binary if it doesn't exist. mkdir -p "$FOUNDRY_BIN_DIR" curl -sSf -L "$BIN_URL" -o "$BIN_PATH" chmod +x "$BIN_PATH" diff --git a/install-foundry-zksync b/install-foundry-zksync index af8f542bb..a42af7780 100755 --- a/install-foundry-zksync +++ b/install-foundry-zksync @@ -3,8 +3,8 @@ set -e # URLs to the raw files on GitHub -INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/foundryup-zksync/install" -FOUNDRYUP_ZKSYNC_URL="https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/foundryup-zksync/foundryup-zksync" +INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/KyberNetwork/foundry-zksync/main/foundryup-zksync/install" +FOUNDRYUP_ZKSYNC_URL="https://raw.githubusercontent.com/KyberNetwork/foundry-zksync/main/foundryup-zksync/foundryup-zksync" # Download the install script echo "Downloading the install script..."