Skip to content

Conversation

liufengyun
Copy link
Contributor

Fix for java command in bin/scala

Co-authored-by: Stephane MICHELOUD stephane.micheloud@gmail.com

Co-authored-by: Stephane MICHELOUD <stephane.micheloud@gmail.com>
@michelou
Copy link
Contributor

Fix for java command in bin/scala

Co-authored-by: Stephane MICHELOUD stephane.micheloud@gmail.com

This was a fast feedback ! Let me check your update with my local changes (NB. Tests with my batch file scala.bat are also on the way 😉).

@michelou
Copy link
Contributor

michelou commented Feb 16, 2021

Fix for java command in bin/scala

Co-authored-by: Stephane MICHELOUD stephane.micheloud@gmail.com

First test results on MingW64 (w/o options) :

$ uname
MINGW64_NT-10.0-19041

user@host MINGW64 /w/dotty
$ for i in compiler/test-resources/scripting/*.sc; do /c/opt/scala-3.0.0-M4-bin-SNAPSHOT/bin/scala $i; done
mainClassFromStack: hashBang$package$
mainClassFromStack: Zoo
script.path: compiler/test-resources/scripting/scriptPath.sc

user@host MINGW64 /w/dotty
$ for i in compiler/test-resources/scripting/*.scala; do /c/opt/scala-3.0.0-M4-bin-SNAPSHOT/bin/scala $i World; done
arg 0: [World]
parentDir: [W:\dotty\compiler\test-resources\scripting]

First test results on Cygwin (w/o options) :

$ uname
CYGWIN_NT-10.0

user@host ~/workspace/dotty-examples/dotty
$ for i in compiler/test-resources/scripting/*.sc; do /cygdrive/c/opt/scala-3.0.0-M4-bin-SNAPSHOT/bin/scala $i; done
mainClassFromStack: hashBang$package$
mainClassFromStack: Zoo
script.path: compiler/test-resources/scripting/scriptPath.sc

user@host ~/workspace/dotty-examples/dotty
$ for i in compiler/test-resources/scripting/*.scala; do /cygdrive/c/opt/scala-3.0.0-M4-bin-SNAPSHOT/bin/scala $i World; done
arg 0: [World]
parentDir: [C:\users\michelou\workspace\dotty-examples\dotty\compiler\test-resources\scripting]

First test results on WIndows prompt (w/o options) :

$ ver
Microsoft Windows [version 10.0.19041.804]

$ for %i in (compiler\test-resources\scripting\*.scala) do @c:\opt\scala-3.0.0-M4-bin-SNAPSHOT\bin\scala %i World
arg 0: [World]
parentDir: [W:\dotty\compiler\test-resources\scripting]

Note: Files compiler\test-resources\scripting\*.sc cannot be executed in the Windows prompt. The file header of *.sc files should be defined somewhere so somebody (e.g. myself) could also support them on Windows.

@liufengyun
Copy link
Contributor Author

Thank you @michelou 👍

@liufengyun liufengyun merged commit a899833 into scala:master Feb 16, 2021
@liufengyun liufengyun deleted the fix-script branch February 16, 2021 10:03
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