0

I have a small helper tool with a CLI that facilitates the notarization process for macos Catalina. It is both run manually in the terminal for ad-hoc notarization, but also in the CI chain. As the notarization process involves a waiting time that can be anywhere between 5s and 15h, it would be nice to:

  • Display on the CLI that the process is still active (some spinner/progress bar)
  • Don't flood the CI logs with every single step the spinner/progress bar iterates through
  • Keep the CI process alive by having some output every x minutes (keep alive ping)

This seems to be a universal problem for all tools used both in CLI and CI context. Now some tools go for parameters like --nospinner or --buildserver, others go for environment variables like BUILDSERVER=1. A third option might be to strip spinners from the logfiles, similar to masking passwords, before saving.

What are the advantages/disadvantages of each approach, and how could this be solved in a better way?

tuexss
  • 219
  • 2
  • 11

1 Answers1

0

I learned from How do I detect whether sys.stdout is attached to terminal or not? that you can detect in what context your output will be shown, and thus you can adjust the update interval accordingly before running spinner/progress bar.

tuexss
  • 219
  • 2
  • 11