Skip to content

Add support for --run - #57

Open
jonascarpay wants to merge 1 commit into
mainfrom
jmc/run
Open

Add support for --run#57
jonascarpay wants to merge 1 commit into
mainfrom
jmc/run

Conversation

@jonascarpay

Copy link
Copy Markdown
Member

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>".
  • I split the Main module into Main.Build and Main.Run.

@considerate

Copy link
Copy Markdown
Member

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.

@considerate

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants