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

Error in build command parsing #64

Closed
natefaubion opened this issue Jan 30, 2020 · 4 comments
Closed

Error in build command parsing #64

natefaubion opened this issue Jan 30, 2020 · 4 comments

Comments

@natefaubion
Copy link
Contributor

The build command splits arguments by space:

let buildCommand = either (const []) (\reg -> (split reg <<< trim) command) (regex "\\s+" noFlags)

But this is problematic with spagos --purs-args flag:

spago build --purs-args="--stash --censor-lib --json-errors"

Since it will chunk these arguments as

[ "build", "--purs-args=\"--stash", "--censor-lib", "--json-errors\"" ]
@natefaubion
Copy link
Contributor Author

The workaround is to use a separate--purs-arg flag for each one:

spago build --purs-args="--stash" --purs-args="--censor-lib" --purs-args="--json-errors"

@nwolverson
Copy link
Owner

Knew this was going to come back to bite eventually,,,

@andys8
Copy link
Contributor

andys8 commented Sep 2, 2020

Would avoid splitting quoted values ("") be a good enough solution to improve this?

@nwolverson
Copy link
Owner

Yes, I'm sure we can split better, not sure if split is easy to use or better to just match words including quoted phrases that may include spaces (easy enough to write/find a regex for that one)

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

No branches or pull requests

3 participants