Skip to content

aliases/aliases: fix naming of symlinks #20246

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

Merged
merged 1 commit into from
Jul 11, 2025
Merged

Conversation

EricFromCanada
Copy link
Member

This fixes a bug in aliases/aliases.rb in which it assumed that the filename of a brew alias symlink in ${HOMEBREW_PREFIX}/bin was the name of the alias. The contents of aliases/alias.rb indicates otherwise: when an alias is first created, the script filename and its symlink have any non-alpahnumeric characters replaced with an underscore—presumably to avoid creating a file with a name starting with a hyphen—so e.g. brew alias test-command --edit creates ~/.brew-aliases/test_command.

No longer occurs:

  • brew alias output shows brew alias test_command instead of brew alias test-command
  • running brew alias creates a new brew-test_command symlink in ${HOMEBREW_PREFIX}/bin beside the existing brew-test-command symlink, which also gets left behind if brew unalias test-command is run

@EricFromCanada EricFromCanada added this pull request to the merge queue Jul 11, 2025
Merged via the queue into main with commit b631179 Jul 11, 2025
36 checks passed
@EricFromCanada EricFromCanada deleted the alias-symlink-names branch July 11, 2025 18:39
@MikeMcQuaid
Copy link
Member

Thanks @EricFromCanada!

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.

3 participants