-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add Bold Brew desktop entry #33
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,26 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| BBREW_PATH="/home/linuxbrew/.linuxbrew/bin/bbrew" | ||||||||||||||||||||||||||||||||||||||||||||||
| BREW_PATH="/home/linuxbrew/.linuxbrew/bin/brew" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if [[ ! -x "$BREW_PATH" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "FATAL: Homebrew is not installed at $BREW_PATH" | ||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| eval "$($BREW_PATH shellenv)" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+14
|
||||||||||||||||||||||||||||||||||||||||||||||
| eval "$($BREW_PATH shellenv)" | |
| # SECURITY NOTE: The following command executes shell code generated by Homebrew. | |
| # If $BREW_PATH or its output is compromised, this could be a security risk. | |
| # We validate $BREW_PATH and check shellenv output before eval. | |
| # Validate that BREW_PATH is the expected binary (optional: check hash or symlink) | |
| if ! [[ "$(readlink -f "$BREW_PATH")" == "/home/linuxbrew/.linuxbrew/bin/brew" ]]; then | |
| echo "FATAL: $BREW_PATH does not resolve to expected Homebrew binary." | |
| exit 1 | |
| fi | |
| SHELLENV_OUTPUT="$($BREW_PATH shellenv 2>/dev/null)" | |
| if [[ $? -ne 0 || -z "$SHELLENV_OUTPUT" ]]; then | |
| echo "FATAL: Failed to get shellenv from Homebrew." | |
| exit 1 | |
| fi | |
| # Basic validation: ensure output only contains variable assignments and 'export' | |
| if ! echo "$SHELLENV_OUTPUT" | grep -Eq '^(export [A-Z_]+=|PATH=|MANPATH=|INFOPATH=)'; then | |
| echo "FATAL: Unexpected output from brew shellenv." | |
| exit 1 | |
| fi | |
| eval "$SHELLENV_OUTPUT" |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The informational message should be directed to stderr instead of stdout since this is a status message and not data output. This prevents the message from interfering with any command output. Change to: echo "Bold Brew first time setup. Installing..." >&2
| echo "Bold Brew first time setup. Installing..." | |
| echo "Bold Brew first time setup. Installing..." >&2 |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The brew install command runs without any confirmation or error handling beyond the final existence check. If the installation fails silently or is interrupted, the user won't get helpful feedback. Consider capturing the installation output and providing more specific error messages, such as: if ! "$BREW_PATH" install Valkyrie00/homebrew-bbrew/bbrew; then echo "FATAL: Installation command failed. Check brew logs for details." >&2; exit 1; fi
| "$BREW_PATH" install Valkyrie00/homebrew-bbrew/bbrew | |
| if ! "$BREW_PATH" install Valkyrie00/homebrew-bbrew/bbrew; then | |
| echo "FATAL: Installation command failed. Check brew logs for details." >&2 | |
| exit 1 | |
| fi |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message should be directed to stderr instead of stdout. Error messages should use >&2 to ensure they appear in the error stream. Change to: echo "FATAL: Installation failed." >&2
| echo "FATAL: Installation failed." | |
| echo "FATAL: Installation failed." >&2 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||
| [Desktop Entry] | ||||||
| Name=Bold Brew | ||||||
| Comment=A terminal UI for managing Homebrew packages and casks | ||||||
| Exec=/usr/libexec/bbrew-launch | ||||||
| Icon=bbrew | ||||||
| Terminal=true | ||||||
| Type=Application | ||||||
| Categories=Development;System; | ||||||
|
||||||
| Keywords=homebrew;brew;package | ||||||
|
||||||
| Keywords=homebrew;brew;package | |
| Keywords=homebrew;brew;package; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message should be directed to stderr instead of stdout. Error messages should use
>&2to ensure they appear in the error stream. Change to:echo "FATAL: Homebrew is not installed at $BREW_PATH" >&2