Skip to content

scala-steward/ammonite-runner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ammonite-runner

Build Status Maven Central

Library and CLI to fetch and run Ammonite scripts

Library

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()

CLI

Example of use

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

License

Copyright (c) 2020, Alexandre Archambault.

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

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%