thiagoelg opened a new issue, #3880:
URL: https://github.com/apache/incubator-kie-tools/issues/3880

   If Windows has `WSL` installed it will make the command `bash` execute WSL 
by default instead of `git-bash`. This is a problem because the `jbang` library 
makes the following comparison to know how to install the `jbang` binary:
   
   ```js
   if (shell.which("curl") && shell.which("bash")) {
     console.log("using curl + bash:", argLine);
     cmdResult = shell.exec("curl -Ls https://sh.jbang.dev | bash -s - " + 
argLine);
   } else if (shell.which("powershell")) {
     console.log("using powershell:", argLine);
     shell.exec('echo iex "& { $(iwr -useb https://ps.jbang.dev) } $args" > 
%TEMP%/jbang.ps1');
     cmdResult = shell.exec('powershell -Command "%TEMP%/jbang.ps1 ' + argLine 
+ '"');
   }
   ```
   
   Having `bash` pointing to WSL means that the `jbang` binary is being 
installed inside WSL and it's not available on Windows itself.
   
   
   Looking at the library I propose 3 possible fixes:
   1. Open a PR on the `jbang` npm library with a fix (checking if `bash` 
points to `git-bash` or the `WSL bash`, falling back to the Powershell install 
method);
   2. Remove the library from our dependencies and write our own script to 
install the `jbang` binary during bootstrap;
   3. Remove the library and add `jbang` as a repository dependency via 
`kieTools.requiredPreinstalledCliCommands` on the `package.json`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to