Questions tagged [ammonite]

Ammonite enhances the Scala REPL and Scala scripts. It also allows Scala to be used as an interactive bash replacement.

67 questions
0
votes
1 answer

how to use sbt/amm scala script on pipe operator?

I want to deal with log output with scala script. Like this: java -jar app.jar | log.sc or java -jar app.jar | amm log.sc How to write a log.sc deal with app.jar print logs? motivation Replace java -jar app.jar > app.log with some smarter way to…
LoranceChen
  • 2,453
  • 2
  • 22
  • 48
0
votes
2 answers

How to know the directory where the current script lies

When writing a script, I'd like to know where lies the current script, in order to locate other files. With a regular Scala script, I know how to do so, but with an Ammonite script I don't.
david.perez
  • 6,090
  • 4
  • 34
  • 57
0
votes
1 answer

using cd! in ammonite scripts fails in 0.7.8, worked in earlier version

Using ammonite 0.7.0 using cd! in scripts would change you to that directory and execute the following bit of code, which was great as i've been using ammonite for build & deploy of a scala project. But in 0.7.8 this does not work any longer, it…
ekydfejj
  • 339
  • 2
  • 14
0
votes
1 answer

Using ammonite repl for Scala scripting

when having a script file (file.sc) with the following content: import ammonite._, Resolvers._ val mock_client_repo = Resolver.Http("Unisay at bintray","http://dl.bintray.com/unisay/maven",MavenPattern,true) interp.resolvers() =…
Eli Golin
  • 373
  • 1
  • 16
0
votes
1 answer

Why Ammonite script fails while REPL runs same code just fine?

I installed ammonite using this: http://www.lihaoyi.com/Ammonite/#Ammonite-Shell ~/.ammonite/predef.sc is as it was after install. interp.load.ivy("com.lihaoyi" %% "ammonite-shell" % ammonite.Constants.version) @ val shellSession =…
user4955663
  • 1,039
  • 2
  • 13
  • 21
0
votes
1 answer

What is the best way of having autocompletion in IDEA for Ammonite scripts

Suppose I do this in my Ammonite script: import ammonite.ops._ but I don't have autocompletion in IDEA, because it doesn't know I'm using this dependency from: "com.lihaoyi" %% "ammonite-ops" % "0.7.7" The same can be said when I import some ivy…
david.perez
  • 6,090
  • 4
  • 34
  • 57
0
votes
1 answer

how to use sudo in ammonite shell"

One thing which sucks about Scala REPL is that there is no straight forward way of loading maven/sbt dependencies. I found ammonite shell which has a convenient thing like load.ivy which is pretty sweet. it also has a decent wrapper over file…
Knows Not Much
  • 30,395
  • 60
  • 197
  • 373
1 2 3 4
5