bump-sh / bump-sh/cli

bump overlay: support overwriting the input OpenAPI file

Open
#589 2 comments 1 reaction 0 assignees View on GitHub
backend devops enhancement overlay realpeople technical typescript
Dominant language
TypeScript
Stars
71
Forks
9
Avg merge
7m
Merged PRs (30d)
4

Description

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:

```sh
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the `bump overlay` command and trace how `--out=INPUTFILE` handles confirmation and input/output paths. Define the in-place overwrite option's behavior for noninteractive CI/CD use, including the cross-platform case, and verify that applying an overlay updates the input file without prompting or truncating it first.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.