arkade
arkade copied to clipboard
[Git Bash] Arkade get OSM path errors
Expected Behaviour
On Windows Git Bash, when running ark get osm
, the last two commands should be able to run on Git Bash with errors.
The commands should be adapted as follow:
chmod +x C:/Users/corsair/AppData/Local/Temp/osm.exe
install -m 755 C:/Users/corsair/AppData/Local/Temp/osm.exe /usr/bin/osm.exe
OR
chmod +x C:\\Users\\corsair\\AppData\\Local\\Temp\\osm.exe
sudo install -m 755 C:\\Users\\corsair\\AppData\\Local\\Temp\\osm.exe /usr/bin/osm.exe
Current Behaviour
The current commands displayed at the end of ark get osm
will generate the follow errors:
chmod +x C:\Users\corsair\AppData\Local\Temp/osm.exe
sudo install -m 755 C:\Users\corsair\AppData\Local\Temp/osm.exe /usr/local/bin/osm.exe
(and without sudo
)
Possible Solution
As stated in the "Expected behaviour", the output commands should be updated for Git Bash
Steps to Reproduce (for bugs)
- Install Git Bash for Windows: https://gitforwindows.org/
- Install Arkade for Git Bash: https://github.com/alexellis/arkade#get-arkade
- Run
ark get osm
- Run
chmod +x C:\Users\corsair\AppData\Local\Temp/osm.exe
- Run
sudo install -m 755 C:\Users\corsair\AppData\Local\Temp/osm.exe /usr/local/bin/osm.exe
Context
Testing Arkade on Git Bash as discussed with @alexellis
Your Environment
- What Kubernetes distribution are you using? Docker Desktop for Windows Kubernetes
kubectl version
v1.18.6
- Operating System and version (e.g. Linux, Windows, MacOS): Windows 10
uname -a
cat /etc/os-release
N/A
- What arkade version is this?
arkade version
0.6.0
Thank you for the issue. arkade install Pam/linkerd works as expected though?
no problem, and I will test the other 2 you're mentioning.
But before that, I do confirm that ark install osm
works fine:
ark install linkerd
ends in error indeed:
Thank you for the detailed report Nuno.
So for Git Bash we primarily need to work on arkade get
For Git Bash users only:
- Suggest copying to /usr/bin/ instead of /usr/local/bin/
- Remove suggestion of sudo
@alexellis I'm trying to figure out if the user is running Git Bash. So far I can think of:
- Checking if the OS is Windows
- The "EXEPATH" env variable by default is set to "C:\Program Files\Git" (this could be used too) What do you reckon?
There's code already that detects the client OS and architecture - you should see it in the codebase, search for "mingw", we can use that. (And yes this applies only to Git Bash on Windows)
for Windows, you might want to check the kernel as it's different for Git Bash and WSL2:
-
Git bash
-
WSL2
For WSL1, I'm not currently running any distro but the kernel would be 4.x with a Microsoft reference
Hope this helps to provide an hint at least.
Thanks for the additional input. We already have code to determine Git Bash (please see my previous comment)
https://github.com/alexellis/arkade/blob/master/pkg/env/env.go#L16
https://github.com/alexellis/arkade/issues/169#issuecomment-671240988
haha, sorry for redundency 😅 then I'll wait for testing it once a first pre-release it out 👍
@nunix please could you confirm if this is still an issue?
@nunix please could you confirm if this is still an issue?
Double that, this issue still stands @nunix?
Hi all,
really sorry for missing this issue (long time didn't use Git Bash).
So the good news is that the osm
binary is correctly copied to $HOME/.arkade/bin
, however the listing of commands from the Arkade install are still not OK (read: we cannot copy/paste them and it works).
Here's the installation output
The output, as mentioned above, should replace the single \
by /
or \\
or, you could leverage the Git Bash $HOME
variable as it shows a *nix path:
Finally, as said above, there's no sudo
in Git Bash, so the last command (adding to /usr/local/bin
will not work). Instead Git Bash should run in "Administrator" mode and the end path should be /usr/bin
as /usr/local
doesn't exist:
Hope this helps, and I'll monitor this issue if any feedback is needed.