Skip to content

Add /opt/homebrew/bin to $PATH when present and a directory #25

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
Oct 11, 2021

Conversation

unixorn
Copy link
Owner

@unixorn unixorn commented Oct 10, 2021

Description

brew doesn't always use /usr/local/bin any more, and macOS doesn't pass the $PATH from .zshrc/.bashrc to GUI applications which caused problems with a brew-installed version of lima.

prep_environment_for_lima() now adds a list of potential directories to $PATH if they exist and are directories - currently /usr/local/bin, /opt/homebrew/bin and /opt/local/bin.

Closes #24

Type of changes

Bugfix

Checklist

  • All new and existing tests pass.
  • Any added/updated scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh and #!/bin/bash are allowed exceptions)
  • Added/updated scripts are marked executable
  • Scripts do not have a language file extension unless they are meant to be sourced and not run standalone. No end-user should have to know if a script was written in bash, python, ruby or whatever. Not including file extensions makes it easier to rewrite the script in another language later without having to change every reference to the previous version.
  • I have confirmed that the link(s) in my PR are valid.

License Acceptance

  • This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.

@unixorn unixorn force-pushed the add-opt-homebrew-bin-to-PATH branch 2 times, most recently from 33e21a8 to 65e0c29 Compare October 10, 2021 19:40
`brew` doesn't always use `/usr/local/bin` any more, and macOS
doesn't pass the `$PATH` from `.zshrc`/`.bashrc` to GUI applications
which caused problems with a `brew`-installed version of `lima`.

`prep_environment_for_lima()` now adds a list of potential directories
to `$PATH` if they exist and are directories - currently `/usr/local/bin`,
`/opt/homebrew/bin` and `/opt/local/bin`.

Closes #24
Signed-off-by: Joe Block <[email protected]>
@unixorn unixorn force-pushed the add-opt-homebrew-bin-to-PATH branch from 65e0c29 to 4eec889 Compare October 10, 2021 19:42
@unixorn unixorn merged commit 46004dd into main Oct 11, 2021
@unixorn unixorn deleted the add-opt-homebrew-bin-to-PATH branch October 11, 2021 02:32
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.

FileNotFoundError: No such file or directory: '/usr/local/bin/limactl'
1 participant