crazyfactory/docker-project-cli

handle "file" gracefully if at least one exists

Closed this issue · 1 comments

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.

alternatively, we can define another optional key instead:

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