Skip to content

Conversation

@ikogan
Copy link
Contributor

@ikogan ikogan commented Sep 5, 2025

No description provided.

- Reexec into zsh if available
- Allow instructions to be used without `gum`
- Fix version comparison so it works with RKE2
- Fix available namespace issues in ZSH
- Attempt to fix downloads when a format isn't specified on Mac OS
- When a project and cluster no longer exist, handle it gracefully by clearing the project.
Copilot AI review requested due to automatic review settings September 5, 2025 17:18
@ikogan ikogan merged commit df71ca3 into main Sep 5, 2025
3 of 4 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements various fixes from user testing of the adp-connect.sh script. The changes focus on improving shell compatibility, fixing bugs in binary installations, and enhancing user interaction.

  • Improved shell compatibility by switching to #!/usr/bin/env bash and adding ZSH support
  • Fixed bug in HAVE_GUM detection and improved error handling in confirmation dialogs
  • Corrected install command usage for cross-platform compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

echo

if [[ -z "${REPLY}" ]]; then
REPLY="Y"
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value 'Y' conflicts with the default 'No' behavior indicated by the [y/N] prompt and the gum confirm command. This should be 'N' to maintain consistent default behavior.

Suggested change
REPLY="Y"
REPLY="N"

Copilot uses AI. Check for mistakes.
fi

if ! [ "${FORCE_CURRENT_SHELL}" = "true" ]; then
if which zsh &>/dev/null && ! [ -z "${BASH}" ]; then
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition ! [ -z \"${BASH}\" ] checks if BASH variable is non-empty, but when running in bash, BASH is typically set. This logic appears inverted - it should likely be [ -z \"${BASH}\" ] to exec zsh when not already in bash.

Suggested change
if which zsh &>/dev/null && ! [ -z "${BASH}" ]; then
if which zsh &>/dev/null && [ -z "${BASH}" ]; then

Copilot uses AI. Check for mistakes.
Comment on lines +634 to +635
echo 'adp-connect has been installed, please re-run it in a terminal with the command
adp-connect, use `adp-connect -h` for help.'
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line continuation was removed but the message now spans multiple lines without proper continuation. This should be a single string with explicit line breaks or use proper line continuation syntax.

Suggested change
echo 'adp-connect has been installed, please re-run it in a terminal with the command
adp-connect, use `adp-connect -h` for help.'
echo -e 'adp-connect has been installed, please re-run it in a terminal with the command\n adp-connect, use `adp-connect -h` for help.'

Copilot uses AI. Check for mistakes.
Comment on lines 1197 to +1200
fi

info "🎉 Everything should now be setup. You should have the following tools installed and ready to use:"
ls -1 "${HOME}"/.local/bin
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fi statement at line 1197 appears to be orphaned - it closes an if block but the corresponding block structure isn't clear from the diff context. Verify this matches the correct if statement.

Copilot uses AI. Check for mistakes.
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 this pull request may close these issues.

2 participants