Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no-fetch/fetch-only modes for "dub describe" #271

Closed
s-ludwig opened this issue Mar 10, 2014 · 2 comments
Closed

Add no-fetch/fetch-only modes for "dub describe" #271

s-ludwig opened this issue Mar 10, 2014 · 2 comments
Milestone

Comments

@s-ludwig
Copy link
Member

Currently there are cases where the JSON output of dub describe is prepended by various log messages. This is obviously an issue for any application that tries to parse the output, especially if there should be a "{" in the non-JSON prolog (fortunately not the case). To avoid this, the idea is to split up any non-describe operations, such as fetching missing dependencies into a separate step.

An IDE would then first issue something like dub describe --fetch-only or dub upgrade --missing-only, which will perform the necessary setup. Then it would call dub describe or dub describe --describe-only which outputs a single JSON document and nothing more. Failure to do the first step would then possibly output an error in the returned JSON output.

See also http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub/thread/1089/

@s-ludwig s-ludwig added this to the 0.9.22 milestone Mar 10, 2014
@bruno-medeiros
Copy link

Note also the case of having JSON error messages for dependencies that don't exist at all, or for those that exist but the version requirements could not be matched.

@s-ludwig
Copy link
Member Author

The solution for now is this: Using dub upgrade --missing-only can be used before dub describe --nodeps to completely separate the describe operation from fetching dependencies. dub describe is now guaranteed to output only JSON for status code 0. For any other status code, the output will be a human readable error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants