-
Notifications
You must be signed in to change notification settings - Fork 171
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
Add the possibility to run scala scripts #142
Conversation
The change looks good. I wonder with the precedent of Btw this is what #122 looks like, using this change:
|
The above is with a I'm assuming you don't have one set either. |
That's correct, Just for clarification: in your comment you mentioned |
Yep, I meant |
I was thinking about renaming the new parameter to Also it may be a bit misleading, as |
I could make more arguments for |
Add the possibility to run scala scripts
Cool, thanks! |
I was going to cast a vote against this but I guess I should move faster. I expect this to create a maintenance burden. I also hate -sbt-create as an option name and would like it shortened to one letter. But my focus is elsewhere so I defer to dale. |
Does anyone run scala scripts using shebang? Once configured, it looks like: #!/usr/bin/env scalas
println("my scala code here") I'm not able to use the current The old script I used is: But it throws the following error now: |
Yes, indeed it did break a year ago. This commit broke |
@dwijnand BTW, you are the author of that commit if I got things right.:) |
OK, I fixed it: https://github.com/paulp/sbt-extras/pull/146/files Offtopic: does anyone know why |
UPD: I think only fixed one of the bugs present now. While fixing this unbound variable was necessary, SBT got broken by a different cause. It broke because of the The "fix" I made accidentally removes a usage of this That's is my impression while working with the code, anyway. I may be wrong. Please correct me if so. |
It's more that |
@dwijnand Probably so. I can't make That means we just can't pass "additional sbt commands" to the latest script launcher. So, we should either revert the tricky Who would be competent or initiative enough to make that decision?... |
This is a very naive implementation in order to support running scala scripts, even in folders that do not contain sbt projects. Saving the following snippet
and running
sbt -script snippet.scala sbt extra
yieldsthus demonstrating that
residual_args
are also properly passed to the script.I'm not sure if this PR would be affected by the bug described in #122.
Any feedback would be very much appreciated.