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
.httpyac.json file not overriding hard coded defaults #3
Comments
Feel free to make a pull request. If not I can also change it tomorrow. I started from the vscode case, and initially wanted vscode settings to win. But I agree with you that it's probably better that way. |
Which Terminal do you use? Chalk supports detection of ansi support. Maybe I can use it. |
I use the default Ubuntu terminal, the colours come out fine on that. |
I used to use Postman, then tried RestClient. I think httpyac will give me more of what I'm looking for. |
have now adjusted the priority. The defaults are now configured in the environmentStore, then httpyac.json and at the end the explicitly passed by the command line. |
For your use case I would use a Post Script and possibly copy and adapt code from toMarkdown GET https://httpbin.org/json
{{
const {toMarkdown} = require('./yourscript.js');
const markdown = toMarkdown(httpRegion);
console.info(markdown); // or require('fs').writeFile('...', markdown);
}} Maybe you use my extension for vscode. There the console outputs are written to a separate OutputChannel. This is what I use for this use case (but without Markdown) |
I published a new release. Can you please verify the change. |
No problem, I'm happy to verify. I'll take a look on Saturday. |
Hi @AnWeber,
to my httpyac.json file to get around it. I've not had a chance to look at the new markdown functionality yet, but I'll look tomorrow. |
Hi @AnWeber, |
Glad I could help. Let me know if you have any other ideas for improvements. |
@timhill-iress: You mentioned, that you were looking for a way to exchange documentation. Currently, notebooks are hyped for exactly this use case. I tried to do just that with httpBook. I'd be interested in your opinion on this, since you actually got me started on it. |
What was I trying to do
I want to turn off console ansi colouring in the output
What did I try
I added a file called .httpyac.json and set the commandline --root parameter to the folder the file was in.
My .httpyac.json file contains:
What did I expect to happen
I expected the console output to not contain Colour Code characters.
Rather than this
�[33maccept-encoding�[0m: gzip, deflate, br
I expected
accept-encoding: gzip, deflate, br
What happened
The output still contained the colour code information
�[33maccept-encoding�[0m: gzip, deflate, br
Offer of help
I'm happy to make change and submit a PR, it may be overkill as it seems to be a one line change
https://github.com/AnWeber/httpyac/blob/main/src/environments/environmentStore.ts#L108
const environmentConfig: EnvironmentConfig = merge({}, ...(await this.loadFileEnvironemntConfigs(rootDirs)), config);
should be
const environmentConfig: EnvironmentConfig = merge({}, config, ...(await this.loadFileEnvironemntConfigs(rootDirs)));
to allow the .httpyac.config to overwrite the default configuration.
The text was updated successfully, but these errors were encountered: