Description
Version(s)
1.4.0
Describe what needs to be done and why
What's the best practice for:
-
having a Scala-cli project, with
project.scala
, and -
having executable
.sc
scripts (with#!/usr/bin/env -S scala-cli
) in the same project (that can be run like./myScript.sc
)
One issue is the warning on the //> using
directives of the scripts. The warning says to move them into project.scala
, but then the scripts cannot be run stand-alone from the Terminal. (Also those directives aren't needed in the project itself, just needed in the scripts... but the scripts are needed along with the project, for the use case.)
Describe alternatives you've considered
One alternative is to simply suppress the warning for executable scripts.
Another is to somehow make use of directives from project.scala
in the scripts.
One more option is to give up on the shebang scripts (with #!/usr/bin/env -S scala-cli
) and ask my users to do scala-cli run . myScript.sc
or something like that. (That way, directives in project.scala
are used I think.)
Additional context