Fix erroneously detecting gum as present when it's not. - #39
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent the script from incorrectly treating gum as installed/usable when it isn’t, and includes a small fix to the checksum-download logging path.
Changes:
- Fix an
infocall that was accidentally passing-eas an argument. - Change the
guminstallation decision to use a runtime check (gum -v) instead ofshould_install "gum".
Suppressed comments (1)
adp-connect.sh:759
- This install guard uses
gum -v(runtime check), but earlierHAVE_GUMis initialized viawhich gum(line 2) and is used before this block (e.g.,confirm()at ~739). Ifwhichreports agumshim/alias/function (not an actual working gum binary), the script will try to rungum confirmbefore reaching this installation block and fail, so this change may not fully address the “gum present when it’s not” scenario.
Consider making HAVE_GUM reflect an executable gum (e.g., using type -P gum and/or gum --version), and/or moving the gum install/validation earlier so any gum-dependent UI paths can’t execute until gum is known-good.
if [[ -n "${FORCE_UPDATE}" ]] || ! gum -v &>/dev/null; then
download_latest_release "charmbracelet/gum" "gum" "tar.gz" || exit 1
extract_download "gum" "tar.gz" || exit 1
install -m "0755" "${TEMP_DIR}/gum"*/"gum" "$HOME/.local/bin/gum" || exit 1
info "🎉 Successfully installed gum!"
HAVE_GUM="true"
fi
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.