Created
August 23, 2018 12:41
-
-
Save fizzy33/a796015c7b29a31d90e867ee846429d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package playground | |
import ammonite.main | |
import ammonite.main.Scripts | |
import ammonite.ops._ | |
object AmmPlay extends App { | |
println("starting") | |
val interpreter = ammonite.Main().instantiateInterpreter().right.get | |
val result = | |
Scripts.runScript( | |
pwd, | |
pwd / "hello-world.sc", | |
interpreter, | |
) | |
println(result) | |
println("complete") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@main | |
def foo() = { | |
println("running foo") | |
"return a string" | |
} | |
println("initializing foo") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
starting | |
initializing foo | |
running foo | |
Success(return a string) | |
complete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment