fix(bash): melos command not found
Is there an existing issue for this?
- [X] I have searched the existing issues.
Version
3.1.0
Description
Problem
melos is not found in the path after installing melos using dart pub global activate melos
Git Bash on Windows (fails)
AzureAD+User@computer MINGW64 ~
$ melos
bash: melos: command not found
PowerShell (works)
melos --version
3.1.0
(Get-Command melos).Path
C:\Users\AlexanderBarker\AppData\Local\Pub\Cache\bin\melos.bat
I checked the the path in Git Bash and the correct location of the bat file is defined as expected:
echo $PATH
...
/c/Users/AlexanderBarker/AppData/Local/Pub/Cache/bin
...
The problem is that Git Bash will not execute bat files directly... so the following would work e.g.
Git Bash
$ melos.bat --version
3.1.0
Solution
I have created a simple fix.
Create a file during install called melos next to melos.bat and use the following contents:
#!/bin/bash
melos.bat $@
This will pass all arguments to the bat file.
Steps to reproduce
- Install and open git bash https://gitforwindows.org/
-
$ dart pub global activate melos - melos
Expected behavior
melos --version
3.1.0
Screenshots
No response
Additional context and comments
No response
Running into the same issue, the above solution works... so if we can get it merged, that would be great. Thanks for all the effort the Ivertase team is making, you guys rock!