Shorter Scala Script header

前端 未结 2 902
萌比男神i
萌比男神i 2021-02-08 20:05

It\'s possible to write shell scripts in Scala by starting a text file with:

#!/bin/sh
exec scala \"$0\" \"$@\"
!#

To ease script creation, I w

2条回答
  •  悲&欢浪女
    2021-02-08 20:25

    See this pull request (was this). There's no issue associated with it -- if you feel like it, you could open an issue and comment on the pull request.

    You can also use SBT to start the scripts. See information about scalas here.

    EDIT

    The pull request was accepted, so this should work:

    #!/usr/bin/env /path/to/scala
    etc
    

提交回复
热议问题