Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

! is not a member of String

Tags:

scala

sbt

I'm trying to upgrade my sbt version from 0.12.3 to 0.13.0 but after it's trying to load a project I get following error:

! is not a member of String

Error occurs in line where I execute external command:

 ("tar cf " + (buildRoot / "SOURCES").toString + "/" + ver + ".tar -C " + buildRoot.toString + " dir").!

In previous version all was fine.

Does anyone know what I'm doing wrong or what has changed in the newest version?

Edit: Problem resolved. It's needed to add:

 import sbt.Process._

in object where are you trying to use postfixOps for example:

  val success:Int = ((dir / "script.sh" toString) !)
like image 684
mickiewicz Avatar asked Dec 28 '25 23:12

mickiewicz


1 Answers

The ! command (for processes) either comes from sbt's process API or from Scala's.

If you're planning to use sbt's logging with forking (HIGHLY recommend), then you want to make sure you import sbt.Process._

Also, you proabbly want to have your code look more like:

val logger: sbt.Logger = ???  //(usually streams.value.log)
val success:Int = (dir / "script.sh" toString) ! logger
like image 74
jsuereth Avatar answered Dec 31 '25 16:12

jsuereth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!