Idempotent and minimal python 3 library for rapid scripting.
Provide support for creating file, adding data to them, patching and so on.


(Ba)sh scripting is very easy to setup. So we end up using it all the time for simple procedural script.

Sometimes is it useful to have idempotent script, like Ansible and Saltstack teach use, this script should only do an action if needed.

I have this need for a complex set of migration procedures.
I was unable to do it bash
It was an overkilll using Java

So runif popped out

Try the examples running them from the root directory

The run() function is very handy to fire direct command, like you would do in a bash script, like running git pull or so on

Note: runif it is NOT a replacement for Gradle, GNU Make, Maven, etc.

Launch example

Install the package with

python install

Here an example of what happen if you run twice the same script:

$ python examples/
[INFO] demo ===> step1
[INFO] demo/demofile.txt ===> step2
[INFO] demo/demofile2.c ===> step2
[INFO] demo/demofile.txt ===> Step3
[INFO] demo/demofile.txt ===>
demo/demofile.txt present!
[INFO] demo\demofile2.c ===>
** demo\demofile2.c

$ python examples/
[INFO] demo/demofile.txt ===>
demo/demofile.txt present!
[INFO] demo\demofile2.c ===>
** demo\demofile2.c

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.