Skip to content

Conversation

@joprice
Copy link
Contributor

@joprice joprice commented Dec 13, 2020

Description of the change

This allows the more general "backend-args" to be used instead of "node-args", since there are now multiple backends and the flag is not actually specific to node. It addresses #709.

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)

Copy link
Member

@f-f f-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joprice thank you for doing this, looks great! Just left some minor comments, it's almost good to go.

src/Spago/CLI.hs Outdated
)

firstNonEmpty x y = if null x then y else x
execArgs = firstNonEmpty <$> backendArgs <*> nodeArgs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have to pick one? I'd expect we could just merge them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong preference. I had it as merge first, but thought that would more surprising than preferring one or the other. For instance, if one script written by one person uses node-args, and another adds backend-args on top, you might expect it to override the first one, since you'd be treating them as equivalent. But, if the semantics of repeating node-args is to combine them, then having both would imply combining for the same reason.

( "test"
, "Test the project with some module, default Test.Main"
, Test <$> mainModule <*> buildOptions <*> nodeArgs
, Test <$> mainModule <*> buildOptions <*> execArgs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now wondering if we should now call the new flag --exec-args or --run-args rather than --backend-args? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I like exec-args better. I guess my variable names betray that.

@joprice
Copy link
Contributor Author

joprice commented Dec 15, 2020

Should I go forward with those two changes - merge instead of override and "exec-args"?

@f-f
Copy link
Member

f-f commented Dec 15, 2020

Should I go forward with those two changes - merge instead of override and "exec-args"?

@joprice sorry for delay, I was travelling yesterday - yes let's go forward with these!

@joprice
Copy link
Contributor Author

joprice commented Dec 16, 2020

Updated. Let me know if I missed anything

Copy link
Member

@f-f f-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you! 🙂

@f-f f-f merged commit 1e6e6d6 into purescript:master Dec 16, 2020
@joprice joprice deleted the backendArgs branch December 16, 2020 19:07
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