scalaammonite

How to get the name of the current script?


How do I get the name of the current script?

For example if I run myscript.sc, I'd like to know the value of myscript I need this for killing previous instances of the script, still running.


Solution

  • sourcecode.File() will return the name of the current script