Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexarchambault/ammonite-runner
Library and CLI to fetch and run Ammonite scripts
https://github.com/alexarchambault/ammonite-runner
ammonite ammonite-scripts cli repl scala
Last synced: 2 months ago
JSON representation
Library and CLI to fetch and run Ammonite scripts
- Host: GitHub
- URL: https://github.com/alexarchambault/ammonite-runner
- Owner: alexarchambault
- Created: 2020-03-20T13:35:09.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T12:54:13.000Z (5 months ago)
- Last Synced: 2024-10-11T08:46:14.399Z (3 months ago)
- Topics: ammonite, ammonite-scripts, cli, repl, scala
- Language: Scala
- Homepage:
- Size: 174 KB
- Stars: 16
- Watchers: 4
- Forks: 5
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ammonite-runner
[![Build Status](https://travis-ci.org/alexarchambault/ammonite-runner.svg?branch=master)](https://travis-ci.org/alexarchambault/ammonite-runner)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.alexarchambault.ammonite/ammonite-runner_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.alexarchambault.ammonite/ammonite-runner_2.13)Library and CLI to fetch and run Ammonite scripts
## Library
```scala
libraryDependencies += "io.github.alexarchambault.ammonite" %% "ammonite-runner" % "0.2.0"
```The latest version is [![Maven Central](https://img.shields.io/maven-central/v/io.github.alexarchambault.ammonite/ammonite-runner_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.alexarchambault.ammonite/ammonite-runner_2.13).
Example of use
```scala
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.