I would like to call sbt update
within my source-code, to update multiple sbt projects. In the shell this is easy:
cd /path/to/project &&
Use one of the ProcessBuilder
factory methods on the Process
object:
sys.process.Process(Seq("sbt","update"), new java.io.File("/path/to/project")).!!
For more documentation, see the scaladoc file for the sys.process package. Unfortunately, it does not mention the 'current working directory' arguments, but they are in the documentation of object Process
.