Closed vinaydigitalsocial closed 4 years ago
Hmm; I think silently ignoring missing files would be dangerous, and could be the source of surprising bugs. Better to fail fast, IMHO.
I would suggest wrapping your call to stackup
with a little bit of script that checks for presence of the file concerned, and selectively adds the extra -p <file>
arguments.
Could you please give an example on this -
" selectively adds the extra -p
I am trying to use it in a make file.
I was thinking along the lines of overrides := $(shell if [ if [ -f "filenotfound.json" ] ]; then echo "-p defaults.json \ -p overrides.json"; else echo "-p defaults.json \ -p overrides.json \p filedoesnotexist.json"; fi)
stackup echo ${overrides} --- not sure if this syntax works
stackup $(overrides)... i think is the right syntax... will try it out
Make, huh? Something like this might work:
OPTIONAL_OVERRIDES = $(patsubst %,-p %,$(wildcard extra-overrides.json))
up:
stackup mystack up -t template.json $(OPTIONAL_OVERRIDES)
I don't think this is a bug.
I don't think this is a bug.
Agreed.
It sounds trivial that the file must exist before using it during an override, but if the stackup command can deal with a missing file then it would be great.
Example - $ stackup myapp-test up -t template.json \ -p defaults.json \ -p overrides.json \ -p filedoesnotexist.json
the above command should not fail