I needed to both debug and then update md.ml, but process_run_block was too big for me to follow properly. This is a start of trying to split it out into code that has smaller units of work, and has unit tests where possible. It also makes explicit the idea that we have some execution state that is being updated after every command, rather than being in a tuple that sort of implied that.
The aim here isn't to be perfect, just nudge things to a state where I find it easier to follow the logic of execution. The API I've added isn't very neat, which is related to the fact that the code is somewhat interesting in many things, but I hope that by defining explicit APIs I can clean up some of the mess I've been making as I've expanded shark with wildcards, environment variable subs, etc.
I needed to both debug and then update md.ml, but
process_run_block
was too big for me to follow properly. This is a start of trying to split it out into code that has smaller units of work, and has unit tests where possible. It also makes explicit the idea that we have some execution state that is being updated after every command, rather than being in a tuple that sort of implied that.The aim here isn't to be perfect, just nudge things to a state where I find it easier to follow the logic of execution. The API I've added isn't very neat, which is related to the fact that the code is somewhat interesting in many things, but I hope that by defining explicit APIs I can clean up some of the mess I've been making as I've expanded shark with wildcards, environment variable subs, etc.