Conversation
Contributor
|
Does this allow you to put basically anything inside .psci? Not that I feel particularly strongly that we should be restricting it, but it might be worth discussing. |
Contributor
Author
|
Yes it does right now. I think it might be better to limit it to imports only. There is also a security risk associated with running arbitrary code on behalf of the user. |
Contributor
Author
|
Fixed. |
hdgarrood
approved these changes
Mar 12, 2017
Contributor
hdgarrood
left a comment
There was a problem hiding this comment.
👍 I'll let you decide what you want to do about my comment.
| case parseCommand l of | ||
| Left err -> liftIO (putStrLn err >> exitFailure) | ||
| Right cmd@Import{} -> handleCommand' state cmd | ||
| Right _ -> liftIO (putStrLn "Only import declarations are supported in the .psci file" >> exitFailure) |
Contributor
There was a problem hiding this comment.
Might be nicer to print a warning, ignore declarations which aren't imports, and continue?
Contributor
|
👍 |
Member
|
|
Contributor
Author
|
Yeah, that makes sense. It is called PSCi elsewhere though. |
mrkgnao
pushed a commit
to mrkgnao/purescript
that referenced
this pull request
Mar 13, 2017
* Add back .psci file support * Restrict .psci to import statements * Only warn * Use .purs-repl
mrkgnao
pushed a commit
to mrkgnao/purescript
that referenced
this pull request
Mar 13, 2017
* Add back .psci file support * Restrict .psci to import statements * Only warn * Use .purs-repl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2734
It looks like this:
cc @chexxor