eik-lib / cli

CLI to publish packages and import maps to Eik, and to manage aliases
https://eik.dev
1 stars 3 forks source link

Add a flag that changes the exit code of `version` to 0 even if there are no new files #597

Open wkillerud opened 1 month ago

wkillerud commented 1 month ago

At the time of writing the eik version command does a comparison of the files currently up on Eik and the ones that are on the local or CI machine, that are about to be (maybe) published.

The exit code for eik version makes it a bit tricky to write automated release workflows using the CLI. In a lot of our projects we do want to continue the CI workflow to deploy the server-side of things, even if the client-side hasn't changed.

I see the use for some kind of signal that "hey, nothing changed, you don't have to continue", so I don't want to change the default behaviour of eik version.

However, some kind of flag that changes the exit code to 0 would be useful. There are workarounds of course, but some kind of designed solution would be nice.

wkillerud commented 1 month ago

Relates to https://github.com/eik-lib/eik-lib.github.io/issues/108

wkillerud commented 1 month ago

A commonly used workaround that achieves the same result, since eik publish exits 0:

eik version || true && eik publish

Documented in the context of GitHub Actions here, including committing eik.json if there are changes: https://github.com/eik-lib/eik-lib.github.io/pull/115