Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,36 @@ OPTIONS:
-h, --help Print help information
-v, --version Install a specific version
-b, --branch Install a specific branch
-r, --repo Install a forks main branch"
-r, --repo Install a forks main branch
-p, --path Install a local repository"
exit 0
fi

# Installs foundry from a local repository if --path parameter is provided
if [[ -n "$FOUNDRYUP_LOCAL_REPO" ]]; then
# Ignore branches/versions as we do not want to modify local git state
if [ -n "$FOUNDRYUP_REPO" ] || [ -n "$FOUNDRY_BRANCH" ] || [ -n "$FOUNDRY_VERSION" ]; then
echo "foundryup: !WARN! --branch, --version, and --repo arguments are ignored during local install"
fi
if ! command -v cargo &> /dev/null ; then
# Error if cargo is not already installed.
echo "foundryup: cargo is not installed. Please install it first."
exit 1
fi
# Enter local repo and build
echo "foundryup: installing from $FOUNDRYUP_LOCAL_REPO"
cd $FOUNDRYUP_LOCAL_REPO
RUSTFLAGS="-C target-cpu=native" cargo build --release # need 4 speed
# Remove prior installations if they exist
rm -f "$FOUNDRY_BIN_DIR/forge"
rm -f "$FOUNDRY_BIN_DIR/cast"
# Symlink from local repo binaries to bin dir
ln -s "$PWD/target/release/forge" "$FOUNDRY_BIN_DIR/forge"
ln -s "$PWD/target/release/cast" "$FOUNDRY_BIN_DIR/cast"
echo foundryup: done!
exit 0
fi

FOUNDRYUP_REPO=${FOUNDRYUP_REPO-gakonst/foundry}
if [[ "$FOUNDRYUP_REPO" == "gakonst/foundry" && -z "$FOUNDRYUP_BRANCH" ]]; then
FOUNDRYUP_VERSION=${FOUNDRYUP_VERSION-nightly}
Expand Down