You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like that after installing ign-tools on Windows, the ign command was available in the three main shells used on Windows:
Command Prompt
Powershell
Git Bash
Actually, I already found a solution for this, and I wanted to mark it down before I forgot.
Git Bash
The least used shell on Windows is the one on which the solution is easier: just rename (or copy) the content of the <prefix>/bin/ign.rb in <prefix>/bin/ign, and the shebang works fine on Windows. However, the name used on Windows is ign.rb instead of just ign due to PR #57 by @ahcorde, so probably there is a reason for that. The summary of the PR reports "Windows requires the extension to run the Ruby file.", but in my case ruby ign on both PowerShell and Command Prompt works fine even without any .rb extension. If for some reason ign.rb is needed, we can anyhow install both ign and ign.rb.
Command Prompt & PowerShell
If instead you are on Command Prompt or PowerShell, an easy way to make sure that if you type ign then eventually the ign ruby script is invoked is to add/install in <prefix>/bin a proxy ign.bat script that just invokes the ruby installer. In particular, I tried a bit and the following script seems to be working fine:
@echo off
REM %~dp0 is the directory in which this bat script is, see
REM https://stackoverflow.com/questions/112055/what-does-d0-mean-in-a-windows-batch-file
REM %* redirects the arguments to the output, see
REM https://serverfault.com/questions/22443/do-windows-batch-files-have-a-construction/22541#22541
ruby %~dp0\ign.rb %*
even if the script is written as a .bat, it seems to be working fine also when invoking ign from PowerShell.
Alternatives considered
Manually invoke the executables that will be eventually added via #7 . However, a lot of tutorials exists that refer to ign, and in any case it will take a long time to read feature parity, so it would be convenient to have some way to run ign on Windows.
Implementation suggestion
Reverting #57 and installing just on Windows the bat script reported earlier should fix the issue. I would be happy to propose a PR, but probably we need to understand the context and motivation of PR #57 .
Desired behavior
I would like that after installing ign-tools on Windows, the
ign
command was available in the three main shells used on Windows:Actually, I already found a solution for this, and I wanted to mark it down before I forgot.
Git Bash
The least used shell on Windows is the one on which the solution is easier: just rename (or copy) the content of the
<prefix>/bin/ign.rb
in<prefix>/bin/ign
, and the shebang works fine on Windows. However, the name used on Windows isign.rb
instead of justign
due to PR #57 by @ahcorde, so probably there is a reason for that. The summary of the PR reports "Windows requires the extension to run the Ruby file.", but in my caseruby ign
on both PowerShell and Command Prompt works fine even without any .rb extension. If for some reasonign.rb
is needed, we can anyhow install bothign
andign.rb
.Command Prompt & PowerShell
If instead you are on Command Prompt or PowerShell, an easy way to make sure that if you type
ign
then eventually the ign ruby script is invoked is to add/install in<prefix>/bin
a proxyign.bat
script that just invokes the ruby installer. In particular, I tried a bit and the following script seems to be working fine:even if the script is written as a
.bat
, it seems to be working fine also when invokingign
from PowerShell.Alternatives considered
Manually invoke the executables that will be eventually added via #7 . However, a lot of tutorials exists that refer to
ign
, and in any case it will take a long time to read feature parity, so it would be convenient to have some way to runign
on Windows.Implementation suggestion
Reverting #57 and installing just on Windows the bat script reported earlier should fix the issue. I would be happy to propose a PR, but probably we need to understand the context and motivation of PR #57 .
Additional context
I wanted to easily debug the test failure in conda-forge/libignition-tools-feedstock#12 (comment) .
The text was updated successfully, but these errors were encountered: