crazyfactory / docker-project-cli

MIT License
4 stars 1 forks source link

handle "file" gracefully if at least one exists #48

Closed adhocore closed 5 years ago

adhocore commented 5 years ago

In dopr config, the root "file" key supports multiple values as array but if any one of them doesnt exist, it errs and exits right away.

We should be able to handle it gracefully as long as at least one file exists.

motivation

we might want to commit dopr config with "file": ["docker-compose.yml", "docker-compose.local.yml"] where "docker-compose.local.yml" is uncommitted file and is not mandatory. if it exists it provides env specific overrides. if it doesnt exist that is alright.

adhocore commented 5 years ago

alternatively, we can define another optional key instead:

{
  "file": ["required/docker-compose/file"], 
  "fileAppend": ["optional/docker-compose/file/to/append/if/exists"]
}