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

[BUG] Yamlinc must fail when $include path was't found #9

Open
svmk opened this issue Oct 5, 2018 · 2 comments
Open

[BUG] Yamlinc must fail when $include path was't found #9

svmk opened this issue Oct 5, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@svmk
Copy link

svmk commented Oct 5, 2018

Version: v0.0.65
Steps to reproduce:

  1. Create file main.yml
some_key: "some_value"
some_data:
    $include: included_file_that_does_not_exists.yml
  1. Run yamlinc main.yml && cat main.inc.yml
    Output:
## --------------------
## DON'T EDIT THIS FILE
## --------------------
## Engine: [email protected]
## Source: main.yml

some_key: some_value
some_data: {}

Expected result:
Yamlinc must exit with status 1 and print error message: "Included file included_file_that_does_not_exists.yml was't found"

@justinnichols
Copy link
Collaborator

v0.1.1 also exhibits this behavior. I agree that this should notify the user, but there may be use cases where not finding a file is the behavior the user would want. I suggest that it should warn the user that a file (or files) weren't found for inclusion, instead of erroring.

The other issue I see is that it's putting {} in its place (indicating an empty map). Should this be an empty string (assuming it won't error and only warn)?

Thoughts?

@francescobianco francescobianco added the enhancement New feature or request label Oct 9, 2018
@francescobianco
Copy link
Member

Hi @svmk @justinnichols
there is a news about this in version 0.1.5
we can use '--strict' option in commad-line

The strict mode stop if 'Problem' occur during runtime (e.g. Syntax error or missing files)
To respect your chain use this:

$ yamlinc --strict main.yml && cat main.inc.yml

On the next day I work to found a solution for {}

francescobianco added a commit that referenced this issue Jan 24, 2019
francescobianco added a commit that referenced this issue Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants