purenix
purenix copied to clipboard
Add support for --run
Initial attempt at #56.
- Argument handling is provisional; it just checks if the argument list is of the form
--run <str>
, and if so, tries to run the test. - Running the test means parsing into a module name and function name, and then calling
nix-instantiate --eval -E "(import ./<moduleName>).<functionName>
".- @considerate In your example, you pass
null
. Why is that?
- @considerate In your example, you pass
- I split the
Main
module intoMain.Build
andMain.Run
.
In the example I pass null
to run the Effect
. I think inspecting whether it’s a function and calling the function with null
would be a strategy that could work.
For reference, spago
always runs the main
function and calls it without any argument (equivalent to calling with null
in purenix
) for the JS backend.