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

Leading whitespace is removed #150

Open
alexdawes opened this issue Jun 13, 2017 · 3 comments
Open

Leading whitespace is removed #150

alexdawes opened this issue Jun 13, 2017 · 3 comments

Comments

@alexdawes
Copy link

From what I can tell, git2consul drops leading whitespace. I was using this to mirror a repo full of yaml files, but trying to parse the yaml from consul was failing. Tracked this to a yaml file of the form

  - foo: Foo
  - bar: Bar

However, the file appearing in git2consul looked like:

- foo: Foo
  - bar: Bar

The former is valid yaml, whilst the latter is not. Changing to

---
  - foo: Foo
  - bar: Bar

worked around the issue, but ideally we would not need to do this (even though IMO its a better syntax).

Is the removal of leading whitespace by design?

@alexdawes
Copy link
Author

Offending line seems to be https://github.com/Cimpress-MCP/git2consul/blob/master/lib/consul/index.js#L245.

      body = body ? body.trim() : '';

Any chance we can remove the trim and do just:

      body = body || '';

@alexdawes
Copy link
Author

#151

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

1 participant