bump-sh / cli

Bump.sh CLI - Deploy your OpenAPI & AsyncAPI documentations from your CI
https://bump.sh
MIT License
44 stars 4 forks source link

bump overlay: support overwriting the input OpenAPI file #589

Open hkosova opened 3 weeks ago

hkosova commented 3 weeks ago

I have several large overlay files that I'm applying one by one and I'd like to have an option to force update the input OpenAPI file in-place. This will help simplify my automation scripts by eliminating the need to create and then delete multiple temporary files with intermediate results.

--out=INPUTFILE works but triggers an interactive confirmation prompt which I think isn't compatible with CI/CD.

> INPUTFILE does not work because it blanks the file before bump can read it, resulting in an error.

| sponge INPUTFILE is a possible workaround for macOS/*nix users, but we also have Windows users who can't use moreutils so it's not an option.


UPD: I found a way to silently overwrite the input spec on macOS/*nix:

echo y | bump overlay myspec.yaml overlay.yaml --out=myspec.yaml

but it would still be great to have a built-in option for cross-platform use.