pyinfra icon indicating copy to clipboard operation
pyinfra copied to clipboard

Add `files.patch` operation

Open alexjp opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe

Some files, I need to change in various places, and its way easier to just diff original modified.

Describe the solution you'd like

I have done a script that patches the files and silently continue if they are already patched.

Could a new feature allow to apply a patch in a idempotent way and also pyinfra have information about it (for example, the "No changes" or the "Success" information)?

Example: A function .patch( name="Patch this configuration file", src="patches/example.patch", destination="/etc/example.conf" )

Thanks !

alexjp avatar Aug 14 '22 20:08 alexjp