Closed eharris369 closed 4 years ago
This looks like it is related to https://github.com/eclipse/codewind/issues/946
I and Andrew investigated further on my machine and cwctl does not list all the enabled templates. We are able to get all the templates from the curl
but not from cwctl
. #946 issue did not fix this problem.
A further problem is that the source
field is missing for the templates. This used to be in the result of the REST API call but is not there in cwctl templates list.
We're switching the eclipse plugin back to using the templates REST API for now. So while this needs to be fixed, it's no longer stopship
@tobespc I'll pick this up.
@jopit Just wondering, are you using the --json
flag straight after the cwctl
? It needs to be this way as it is a global flag, if you put it anywhere else it'll throw an error.
cwctl --json templates list --showEnabledOnly true
Looks like the CLI might be adding projectStyle=Codewind
to the templates list
command without specifying any options.
The URL after the Query.add
s is http://127.0.0.1:34077/api/v1/templates?projectStyle=Codewind&showEnabledOnly=false
When no value is given for projectStyle
the CLI is defaulting to Codewind
.
https://github.com/eclipse/codewind-installer/blob/master/pkg/actions/commands.go#L279
I'll change this to not have a default value, for UX I'm also changing the showEnabledOnly
flag to be a boolean so the user can either do --showEnabledOnly true
as is implemented now or just --showEnabledOnly
which has the same effect.
I've made the changes in this PR which just needs testing written for it and then can be accepted. https://github.com/eclipse/codewind-installer/pull/197
@eharris369 could you please retest with latest and close this issue if its resolved.
I have only the appsody template source enabled (see below) but when I run
cwctl templates list --showEnabledOnly true
I get null and when I runcwctl templates list
I get only the Codewind templates. I am on Windows 10 Enterprise using the latest Codewind (pulled down from git and built) and the latest cwctl build and appsody 0.4.8 release build.Even if the list of templates is really empty shouldn't it return an empty array instead of null? Also the --json option is supposed to be universal but adding it to this command gives me an error. I want to be able to just add it to all commands in the IDE.