Skip to content

Conversation

@miangraham
Copy link
Contributor

@miangraham miangraham commented Jun 16, 2019

Description of the change

First pass at --node-args (fix #267)

$ spago run
Installation complete.
Build succeeded.
["/usr/bin/node"]
$ spago run -n "foo bar"
Installation complete.
Build succeeded.
["/usr/bin/node","foo","bar"]

Checklist:

  • Added the change to the "Unreleased" section of the changelog
  • Added some example of the new feature to the README
  • Added a test for the contribution (if applicable)

@f-f
Copy link
Member

f-f commented Jun 17, 2019

Looks great, thank you! 👏

@f-f f-f merged commit 5f86f27 into purescript:master Jun 17, 2019
elliotdavies pushed a commit to elliotdavies/spago that referenced this pull request Jul 1, 2019
@paluh
Copy link

paluh commented Jul 28, 2019

I want to ask a question about this feature. Currently spago executes a javascript expression (using node -e option) during run and test. This strategy changes the behavior of option passing when we compare it to directly running a bundle:

$ node output/bundle.js --help

passes three values: [PATH_TO_NODE, PATH_TO_SCRIPT, "--help"]

$ spago run --node-args --help

passes option directly to node and not to the purescript module. This is how node processes arguments with -e option.

$ spago run --node-args "-- --help"

passes two values [PATH_TO_NODE, "--help"]

Libraries like purescript-optparse here or purescript-optlicative here assume the first two arguments to be node path and script path.
I think that we should provide consistent solution for arguments passing as this can be really important during testing or even development.

What do you think Guys?

@f-f
Copy link
Member

f-f commented Jul 28, 2019

@paluh if I read your comment correctly this should be fixed in master (went in with #297), so it will ship with the next release

@paluh
Copy link

paluh commented Jul 28, 2019

Yeah! Thanks!

@f-f
Copy link
Member

f-f commented Jul 28, 2019

You're welcome 🙂

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.

spago run -- needs to pass through args to node, or have some mechanism to do so

3 participants