Platonic-Systems / mission-control

A `flake-parts` module for your Nix devshell scripts
https://community.flake.parts/mission-control
MIT License
80 stars 11 forks source link

An option to not print the banner under CI #36

Closed algernon closed 1 year ago

algernon commented 1 year ago

I recently started to use mission-control, and noticed that the banner is always printed when entering the devshell - normally good behaviour, but I also happen to run the dev shell during CI runs, and printing the banner for pretty much every step made my build logs much more verbose than they need to be, and a bit annoying to glance through. See here for an example - just expand any step beyond bootstrap to see what I mean.

I could work it around by setting a custom banner that checks the $CI environment variable, and does not display the banner if it is set. But that meant replicating the entire banner snippet.

Would it be possible to have an option like mission-control.banner-display-condition? A shell snippet that the default banner uses like ${banner-display-condition} && menu? It'd default to true, but would make it easier for me to override it: mission-control.banner-display-condition = ''[ -z "$CI" ]'';.

I'm happy to open a pull request adding this (possibly with a better option name - I'm not good at naming), if this is something you'd find useful too. I might even be able to name it mission-control.banner.display-condition, while also remaining backwards compatible, so mission-control.banner = ''<some text>''; would still work.