Skip to content
vic

alexarchambault/ammonite-runner

Library and CLI to fetch and run Ammonite scripts

alexarchambault/ammonite-runner.json
{
"createdAt": "2020-03-20T13:35:09Z",
"defaultBranch": "main",
"description": "Library and CLI to fetch and run Ammonite scripts",
"fullName": "alexarchambault/ammonite-runner",
"homepage": "",
"language": "Scala",
"name": "ammonite-runner",
"pushedAt": "2024-08-21T12:54:13Z",
"stargazersCount": 16,
"topics": [
"ammonite",
"ammonite-scripts",
"cli",
"repl",
"scala"
],
"updatedAt": "2024-05-09T13:57:24Z",
"url": "https://github.com/alexarchambault/ammonite-runner"
}

Build Status Maven Central

Library and CLI to fetch and run Ammonite scripts

libraryDependencies += "io.github.alexarchambault.ammonite" %% "ammonite-runner" % "0.2.0"

The latest version is Maven Central.

Example of use

import ammrunner._
val file: java.io.File = ???
val versions = VersionsOption.fromScript(file)
// Latest matching scala / Ammonite versions if none are set in script
.getOrElse(Versions.default())
val command = AmmoniteFetcher(versions)
.command()
.fold(throw _, identity)
val proc: Process = command
.withArgs(Seq(file.getAbsolutePath))
.run()
val retCode: Int = proc.waitFor()

Example of use

$ cs launch io.github.alexarchambault.ammonite::ammonite-runner-cli:latest.release -- script.sc

Copyright (c) 2020, Alexandre Archambault.

All files in this repository can be used either under the Apache 2.0 license.