Closed slskiba closed 1 week ago
I get different results:
$ ide -v
2024.06.001-alpha-SNAPSHOT
Successfully completed ide (-v)
$ ide get-version aws
2.15.58
Successfully completed ide (get-version,aws)
$ ide get-edition aws
aws
Successfully completed ide (get-edition,aws)
Can you specify how to reproduce the CliException: Tool is not installed
case?
However, some things are inconsistent:
$ ide get-edition docker
The configured edition for tool docker is rancher
To install that edition call the following command:
ide install docker
Successfully completed ide (get-edition,docker)
I also was now able to reproduce the reported error:
$ ide get-version helm
Step 'ide (get-version,helm)' failed: com.devonfw.tools.ide.cli.CliException: Tool helm is not installed!
1 step(s) failed out of 1 steps.
Tool helm is not installed!
Error: IDEasy failed with exit code 4
Seems like aws is installed in your case. The exception of course occurs when a tool is not installed. However get-edition does not throw this exception when a tool is not installed - I suggest they should behave similar when called on a tool that is not installed.
FYI: My expectation is that get-version
only prints the version and get-edition
only prints the edition.
We can also log the verbose message texts around this but on debug level.
So I would expect this:
$ ide get-edition docker
rancher
$ ide -d get-edition docker
The configured edition for tool docker is:
rancher
To install that edition you can call the following command:
ide install docker
UPDATE: OK. Now I got the difference. If the tool is installed, I get the installed edition and version (I wounder how I could actually determine the installed edition. IMHO there is currently no way to do this).
However for get-version
I could get something like 21*
for Java if the tool is not installed. I could still print the resolved version that would be installed if I do install it now...
$ ide get-edition docker rancher
I am unable to reproduce this result. I am experiencing the following for docker (with rancher installed), and aws (not installed):
ide> get-edition docker
The configured edition for tool docker is rancher
To install that edition call the following command:
ide install docker
Successfully completed ide (get-edition,docker)
ide> get-version docker
Step 'ide (get-version,docker)' failed: com.devonfw.tools.ide.cli.CliException: Tool docker is not installed!
1 step(s) failed out of 1 steps.
[..]
ide> get-edition aws
The configured edition for tool aws is aws
To install that edition call the following command:
ide install aws
Successfully completed ide (get-edition,aws)
ide> get-version aws
Step 'ide (get-version,aws)' failed: com.devonfw.tools.ide.cli.CliException: Tool aws is not installed!
1 step(s) failed out of 1 steps.
[..]
However I would expect:
ide> get-edition docker
The configured edition for tool docker is rancher
To install that edition call the following command:
ide install docker
ide> get-version docker
The configured version for tool docker is *
To install that version call the following command:
ide install docker
ide> get-edition aws
The configured edition for tool aws is aws
To install that edition call the following command:
ide install aws
ide> get-version aws
The configured version for tool aws is 2*
To install that version call the following command:
ide install aws
While there might be more appropriate output for docker, the current implementation of get-version
and get-edition
are based on finding the tool in the software path, which simply isn't applicable for global tools.
Actual behavior
Inconsistent behaviour:
get-edition
of a local tool that is not installed provides the configured edition and instructions on how to install the tool, howeverget-version
of a local tool that is not installed results in aCliException: Tool <tool> is not installed
get-version
of a global tool fails inCliException: Tool <tool> is not installed
: Tool not installed, whether it is installed or not.Related Issues
399
428
Comments/Hints:
The current implementation for get-version and get-edition is only applicable to local tools.