Skip to content

Commit

Permalink
Fix regression in CLI (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault authored Jun 7, 2020
1 parent 9bdeece commit 5d840ed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/src/main/scala/ammrunner/cli/AmmRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ object AmmRunner extends CaseApp[Options] {

val scriptPathOpt = args.remaining.headOption.filter(!_.startsWith("-"))

def fetcher(versions: Versions) =
AmmoniteFetcher(versions)
.withInterpOnly(false)

val command = scriptPathOpt match {
case None =>
val versions = options.versionsOpt
.getOrElse(Versions.default())

AmmoniteFetcher(versions).command() match {
fetcher(versions).command() match {
case Left(e) => throw new Exception("Error getting Ammonite class path", e)
case Right(cmd) => cmd
}
Expand All @@ -36,7 +40,7 @@ object AmmRunner extends CaseApp[Options] {
.orElse(VersionsOption.fromScript(script))
.getOrElse(Versions.default())

AmmoniteFetcher(versions).command() match {
fetcher(versions).command() match {
case Left(e) => throw new Exception("Error getting Ammonite class path", e)
case Right(cmd) => cmd.withArgs(Seq(scriptPath))
}
Expand Down

0 comments on commit 5d840ed

Please sign in to comment.