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

Barber is unable to use any input JSON file #1

Open
godefroi opened this issue Mar 1, 2022 · 2 comments
Open

Barber is unable to use any input JSON file #1

godefroi opened this issue Mar 1, 2022 · 2 comments

Comments

@godefroi
Copy link

godefroi commented Mar 1, 2022

I can run the example render command given in the readme that passes in Var1 on the command line, but all attempts to run the render command with a JSON file as input result in the following error message:

Unexpected character encountered while parsing number: \. Path '', line 1, position 1.

I have tried an empty JSON file, a JSON file with only an empty object ({ }), and a JSON file with valid JSON in it. All attempts result in the same error message.

@godefroi
Copy link
Author

godefroi commented Mar 1, 2022

You'll see here: https://github.com/vankooch/barber/blob/master/app/Barber.Cli/Commands/RenderCommand.cs#L67 that you aren't actually opening the file and reading in the contents, you're just attempting to parse the filename as the JSON data.

As a bonus, a couple lines above, the error message when the JSON file doesn't exist actually spits out the name of the template.

@vankooch
Copy link
Owner

vankooch commented Mar 3, 2022

Hi thanks for the feedback. I'll look into that this weekend.

Best regards

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