We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version(s)
$ scala-cli --version Scala CLI version: 0.1.18 Scala version (default): 3.2.1
Describe the bug
Scala-CLI ignores the “using directives” of my executable script that uses the shebang command.
To Reproduce
Consider a file Test.scala:
Test.scala
$ ls -l total 4 -rwxrwxr-x 1 julien julien 288 Dec 4 15:56 Test.scala
It contains a regular Scala-CLI script and uses the shebang command:
$ cat Test.scala #!/usr/bin/env -S scala-cli shebang //> using scala "2.13.8" //> using repository "https://artifacts.unidata.ucar.edu/repository/unidata-all" //> using lib "edu.ucar:grib:5.3.1" import ucar.nc2.dt.grid.{GeoGrid, GridDataset} object Main { def main(args: Array[String]): Unit = () }
Note that the script uses Scala 2.13.8, and one library dependency.
Trying to run it (on Ubuntu):
$ ./Test.scala Compiling project (Scala 3.2.1, JVM) [error] ./Test.scala:6:8: Not found: ucar [error] import ucar.nc2.dt.grid.{GeoGrid, GridDataset} [error] ^^^^ Error compiling project (Scala 3.2.1, JVM) Compilation failed
The import is not resolved, and the Scala version is wrong.
Note that the regression seems to be pretty recent as it was working not a long time ago.
Expected behaviour
Scala-CLI does take into account the using directives of the file.
Workaround
scala-cli run Test.scala -- ...
The text was updated successfully, but these errors were encountered:
.scala
Gedochao
Successfully merging a pull request may close this issue.
Version(s)
Describe the bug
Scala-CLI ignores the “using directives” of my executable script that uses the shebang command.
To Reproduce
Consider a file
Test.scala
:It contains a regular Scala-CLI script and uses the shebang command:
Note that the script uses Scala 2.13.8, and one library dependency.
Trying to run it (on Ubuntu):
The import is not resolved, and the Scala version is wrong.
Note that the regression seems to be pretty recent as it was working not a long time ago.
Expected behaviour
Scala-CLI does take into account the using directives of the file.
Workaround
scala-cli run Test.scala -- ...
The text was updated successfully, but these errors were encountered: