forked from omni-network/omni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_foundry.sh
34 lines (26 loc) · 1.09 KB
/
install_foundry.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
#!/usr/bin/env bash
# Install foundryup and foundry toolkit (forge, cast, anvil)
# If already forge installed, exit. (we do not care about cast or anvil
if which forge 1>/dev/null; then
echo "Foundry already installed: $(forge --version)."
echo "Run 'foundryup' to update."
return
fi
# This tells https://foundry.paradigm.xyz where to install foundryup -
# $FOUNDRY_DIR/bin. This dir is added to $GITHUB_PATH in
# .github/workflows/pre-commit.yml
export FOUNDRY_DIR="$HOME/.foundry";
# If foundryup not installed, install it
if ! which foundryup 1>/dev/null; then
echo "Installing foundryup"
curl -L https://foundry.paradigm.xyz | bash
fi
# We use the nightly version, rather than pinning to a specific version.
# foundryup does allow pinning to a specific version, via github tag:
# foundryup --version nightly-24abca6c9133618e0c355842d2be2dd4f36da46d
# Or via git commit:
# foundryup --commit 24abca6
# But they delete github tags frequently, and installation via commit requires
# rust and lenghty builds. So we use nightly, until versioning becomes an
# issue.
foundryup --version nightly