fix(self-update): improve update UX on macOS#1872
Open
nadav-y wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves the Unix self-update experience by running the installer script under bash (to avoid macOS /bin/sh echo-flag behavior) and by showing a curl progress bar during downloads.
Changes:
- Switch
_get_installer_run_command()to preferbashon Unix. - Update unit + integration tests to expect
bash-based execution. - Replace
curl --silentwithcurl --progress-barfor the public download path ininstall.sh.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/apm_cli/commands/self_update.py |
Updates the Unix installer runner to use bash. |
tests/unit/test_update_command.py |
Adjusts helper tests for the new bash selection behavior. |
tests/integration/test_commands_config_coverage.py |
Updates integration coverage assertion to require bash. |
install.sh |
Enables a visible progress bar for the initial unauthenticated download. |
73a3727 to
e25d228
Compare
Collaborator
Author
|
This is how the old code looked like: New one doesn't have the |
Two QoL improvements to the Unix self-update flow: - Invoke install.sh with bash instead of /bin/sh. On macOS, /bin/sh is bash 3.2 running in POSIX compatibility mode, where the echo builtin does not recognize the -e flag and prints it literally — prefixing every colored output line with `-e`. Using bash (via shutil.which with /bin/bash fallback, raising FileNotFoundError if neither exists) respects the script's shebang and produces clean output. - Replace curl --silent with --progress-bar across all download paths in install.sh (unauthenticated, GitHub API, and direct URL with auth) so users get visual feedback during the binary download. Windows (install.ps1) is unaffected: Invoke-WebRequest renders its own progress bar natively and PowerShell is already invoked explicitly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e25d228 to
9b93b2c
Compare
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.
Two small quality-of-life fixes to the
apm updateflow on Unix.Changes
Fix
-egarbage output on macOS during self-update_get_installer_run_commandwas invokinginstall.shwith/bin/sh. On macOS,/bin/shis bash 3.2 running in POSIX compatibility mode, where theechobuiltindoes not recognize the
-eflag and prints it literally — so every colored outputline printed with
echo -e "..."appeared prefixed with-ein the terminal.Switching to
bash(viashutil.which("bash"), falling back to/bin/bash,raising
FileNotFoundErrorif neither exists) respects the script's own shebangand fixes the output.
Show a progress bar during binary download
install.shusedcurl --silent --show-error, which suppresses all output including the progress bar. Replacing--silentwith--progress-bargives users visual feedback during the download without adding verbose byte-count noise.Notes
install.ps1) is unaffected —Invoke-WebRequestrenders its own progress bar natively_get_installer_run_commandupdated to match new behavior