What is Nostr?
Brett Cannon /
npub1fdq…2uv4
2024-05-08 01:44:52

Brett Cannon on Nostr: Looking for a Bash one-liner to tell by exit code whether your Git checkout is dirty? ...

Looking for a Bash one-liner to tell by exit code whether your Git checkout is dirty?

`if [ -n "$(git status --porcelain)" ]; then (exit 1); fi`

I sought this out for GitHub Actions so that I could set up a formatting command for a project and then check in CI if it would change anything instead of having a second command just for the check (e.g. `black` followed by this in CI instead of having a separate, dedicated `black --check` just for CI). Basically trying up the DRY on maintenance stuff
Author Public Key
npub1fdqq95m3f5r5escjzr57v5yggphf7cs4gqgd5ykr882pkx9npussqc2uv4