samba-in-kubernetes / sambacc

A library and CLI tools for managing Samba servers in containers.
GNU General Public License v3.0
13 stars 16 forks source link

commands: add new generic --skip-if command line options #120

Closed phlogistonjohn closed 5 months ago

phlogistonjohn commented 5 months ago

Depends on: #119

Previously, sambacc had the --skip-if-file= command line option that would skip running a command if a named file exists. I have a need for doing something similar for environment variable contents. In order to avoid needing to add a plethora of new --skip-if-x type options over time, add a more generic --skip-if= option and have the value contain an initial prefix like file: or env: that determines how the rest of the value will be parsed and how the skip will be determined (or not). Deprecate --skip-if-file.

Maybe it's a case of over engineering, but at least it's easy to unit test.

Examples:

phlogistonjohn commented 5 months ago

cc: @avanthakkar - for an additional review & peek into this code base

dpulls[bot] commented 5 months ago

:tada: All dependencies have been resolved !

phlogistonjohn commented 5 months ago

I noticed a stray debugging print statement was still in the unit test file. It's now removed.