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

Merge not merging? #45

Closed
Infinoid opened this issue Jul 11, 2021 · 2 comments
Closed

Merge not merging? #45

Infinoid opened this issue Jul 11, 2021 · 2 comments

Comments

@Infinoid
Copy link

Hi,

Trying out this tool and I have a stupid question. Why doesn't merge merge?

thing1.yaml:

a:
  b: c

thing2.yaml:

a:
  d: e

spruce merge does what I expect:

$ spruce merge thing1.yaml thing2.yaml
a:
  b: c
  d: e

But aviator seems to ignore the second file.

$ cat aviator.yml
spruce:
  - base: thing1.yaml
    merge:
    - with:
      files:
      - thing2.yaml
    to: things.yaml
$ aviator
SPRUCE MERGE:
	thing1.yaml
	to: things.yaml

$ cat things.yaml
a:
  b: c

Why didn't the contents of thing2.yaml get merged into the output?

@herrjulz
Copy link
Owner

Hi @Infinoid ,
sorry for my late response. I really need to get better at monitoring the issues on Aviator. Anyways, I hope I'm not to late to this and thank you very much for trying out aviator!

The only problem is that your aviator.yaml has a small yaml syntax issue. You need to indent the files section inside the merge section. Like this:

spruce:
  - base: thing1.yaml
    merge:
    - with:
        files:
        - thing2.yaml
    to: things.yaml

files is a part of with. To make it more clear probably that part in JSON helps:

[{
  with: { 
     files: [myfile.yml]
  }
}] 

Let me know if that helped!

I can absolutely see that the confusion might come from the README. I saw examples where the indentation is missing. I'm fixing it right away!

Thank you for opening this issue.

@Infinoid
Copy link
Author

You're right, that was my problem. It seems to be behaving better now. And yes, I was basing my work on the examples in the README.

Thanks!

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