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

fix(foundryup): actually make set -e work #6352

Merged
merged 2 commits into from
Nov 18, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
shellchecks
  • Loading branch information
DaniPopes committed Nov 18, 2023
commit 60518fe86643fe8ed458e2170ecf573705179b72
10 changes: 6 additions & 4 deletions foundryup/foundryup
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ main() {
need_cmd git
need_cmd curl

while [[ $1 ]]; do
while [[ -n $1 ]]; do
case $1 in
--) shift; break;;

Expand Down Expand Up @@ -91,7 +91,8 @@ main() {

say "installing foundry (version ${FOUNDRYUP_VERSION}, tag ${FOUNDRYUP_TAG})"

PLATFORM=$(tolower "${FOUNDRYUP_PLATFORM:-$(uname -s)}")
uname_s=$(uname -s)
PLATFORM=$(tolower "${FOUNDRYUP_PLATFORM:-$uname_s}")
EXT="tar.gz"
case $PLATFORM in
linux) ;;
Expand All @@ -107,7 +108,8 @@ main() {
;;
esac

ARCHITECTURE=$(tolower "${FOUNDRYUP_ARCH:-$(uname -m)}")
uname_m=$(uname -m)
ARCHITECTURE=$(tolower "${FOUNDRYUP_ARCH:-$uname_m}")
if [ "${ARCHITECTURE}" = "x86_64" ]; then
# Redirect stderr to /dev/null to avoid printing errors if non Rosetta.
if [ "$(sysctl -n sysctl.proc_translated 2>/dev/null)" = "1" ]; then
Expand Down Expand Up @@ -273,7 +275,7 @@ ensure() {

# Downloads $1 into $2 or stdout
download() {
if [ "$2" ]; then
if [ -n "$2" ]; then
# output into $2
if check_cmd curl; then
curl -#o "$2" -L "$1"
Expand Down
Loading