Claus Ibsen created CAMEL-26944:
-----------------------------------

             Summary: camel-jbang - the Windows scripts run findstr, 
powershell, curl and java from the system, not from the current directory
                 Key: CAMEL-26944
                 URL: https://issues.apache.org/jira/browse/CAMEL-26944
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


The Windows scripts of the Camel CLI run some programs by their bare name. cmd 
looks for a bare name in the current directory before PATH, so a findstr.bat, 
powershell.bat, curl.bat or java.bat in the directory where camel runs (for 
example a cloned project) is run instead of the real program.

* camel.bat (camel-launcher) runs findstr three times by bare name.
* camelw.cmd (the wrapper that camel wrapper writes into a project) runs 
powershell and curl by bare name, and uses java by bare name when JAVA_HOME is 
not set.

The scripts should run findstr, powershell and curl from %SystemRoot%\System32, 
and find java.exe on PATH only (%~$PATH:), as camel.bat already does.

camelw.cmd also always reports a failed download when PowerShell fails and curl 
then succeeds: the curl check reads %ERRORLEVEL% inside the same parenthesized 
block, which cmd expands when it reads the block, so it still sees the 
PowerShell error.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to