Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
justinwoo opened this issue Jun 15, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@justinwoo
Copy link
Collaborator

commented Jun 15, 2019

Main.js

exports.argv = process.argv;

Main.purs

module Main where

import Prelude

import Effect (Effect)
import Effect.Aff as Aff
import Effect.Class.Console (logShow)

foreign import argv :: Array String

main :: Effect Unit
main = Aff.launchAff_ do
  logShow argv

actual:

$ spago run -- afwaefwaefo
Installation complete.
purs compile: No files found using pattern: afwaefwaefo
Build succeeded.
["my/bin/node"]

expected:

$ node -e "require('./output/Main').main()" 12313 owijewejf
["my/bin/node","12313","owijewejf"]
@f-f

This comment has been minimized.

Copy link
Member

commented Jun 16, 2019

There is a small issue here, and it's that everything that goes after -- gets passed to purs in all commands that might build (build, bundle-*, run, etc), so I think we should keep it like that everywhere for consistency.

So how about adding a --node-args flag to the test and run commands?

@miangraham

This comment has been minimized.

Copy link
Contributor

commented Jun 16, 2019

Got some open hacking time and just finished adding other new arg. I can try a first pass at this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.