leapp: Leapp doesn't detect AWS CLI in newer homebrew locations
Describe the bug
Leapp seems to only search for the AWS CLI in /usrl/local/bin.
Leapp Version 0.11.0
To Reproduce Steps to reproduce the behavior:
- Obtain a new M1 Mac 😃
- Install Homebrew
- Install AWS CLI va Homebrew (
brew install awscli) - Install Leapp
- Launch Leapp
Expected behavior
Leapp should detect alternative locations of the AWS CLI or allow me to configure the location. The new homebrew path is /opt/homebrew/bin. Although, it’s probably best for Leapp to search PATH for the command.
Screenshots

Desktop (please complete the following information):
- macOS 12.3.1
- Leapp 0.11.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 11
- Comments: 15 (10 by maintainers)
just create a soft link
sudo ln -s /opt/homebrew/bin/aws /usr/local/bin/awsand don’t forget to install the Session Manager too
Yes, we can remove it, I think. Thanks for the suggestion
Thanks @josemiguel. I did the following and it worked for me.
I noticed that the red warning now includes a link with instructions on how to create a symlink. By the way, the instructions would be clearer if they contained a typical example.
Then, after I created the link, I was surprised to see another similar-looking red warning that on closer inspection was telling me about the session-manager-plugin, even though I don’t use the session-manager-plugin, and this time the link did not explain how to create a symlink.
The following worked with my brew-installed utils:
Some digging through the code… It seems like it’s trying to guess the absolute path of the binaries instead of relying on the
$PATHof the default shell to resolve it.https://github.com/Noovolari/leapp/blob/e11df16679792f62e9d24fc15acfdc8baacedd82/packages/desktop-app/src/app/components/tray-menu/tray-menu.component.ts#L238-L241
https://github.com/Noovolari/leapp/blob/e11df16679792f62e9d24fc15acfdc8baacedd82/packages/desktop-app/src/app/components/tray-menu/tray-menu.component.ts#L253-L256
https://github.com/Noovolari/leapp/blob/e11df16679792f62e9d24fc15acfdc8baacedd82/packages/core/src/services/execute-service.ts#L23-L43
A few ways to solve it
$PATHenv var of the default shell. Works for all commands.whichcommand to find the location of the binary. Works for most commands except forcdwhich is built-in to the shell.brew --prefixwhich returns/opt/homebrewon M1 to find the/binprefix to better guess the path. Would work better but would maintain the brittleness of the current logic.