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

Installation script does not handle unknown parameters well #919

Closed
2 tasks done
sttcns opened this issue Dec 25, 2024 · 1 comment · Fixed by #920
Closed
2 tasks done

Installation script does not handle unknown parameters well #919

sttcns opened this issue Dec 25, 2024 · 1 comment · Fixed by #920

Comments

@sttcns
Copy link

sttcns commented Dec 25, 2024

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • your problem was from running the official install or uninstall script?
  • after installation: ran brew config and brew doctor and included their output with your issue? If you couldn't install: provided your OS version with the output of your issue?

What you were trying to do (and why)

Download the installation script and run it with an unknown parameter.

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install.sh
./install.sh ASDF

What happened (include command output)

The script fails, because warn function is used on line 58 before its declaration on line 97.

Command output
./install.sh: line 58: warn: command not found
Homebrew Installer
Usage: [NONINTERACTIVE=1] [CI=1] install.sh [options]
    -h, --help       Display this message.
    NONINTERACTIVE   Install without prompting for user input
    CI               Install in CI mode (e.g. do not prompt for user input)

What you expected to happen

The error handled gracefully.

Step-by-step reproduction instructions (by running brew commands)

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o install.sh
./install.sh ASDF
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
ZhongRuoyu added a commit that referenced this issue Dec 26, 2024
`warn` is defined after its usage.

Fixes #919.
@ZhongRuoyu
Copy link
Member

Thanks for reporting; this should be fixed by #920.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants