Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`sbt run` from outside the project directory

Tags:

When I want to run my Scala project, I cd to the project directory and do

$ sbt "run arg1" 

How can I do the same operation from outside the project directory?

like image 994
dhg Avatar asked Jul 10 '12 19:07

dhg


People also ask

Does sbt run compile?

sbt is a popular tool for compiling, running, and testing Scala projects of any size. Using a build tool such as sbt (or Maven/Gradle) becomes essential once you create projects with dependencies or more than one code file.


1 Answers

My answer is inpired by this more general question: How do I run a program with a different working directory from current, from Linux shell?

(cd myPath/; sbt "run arg1") 

or

(cd myPath/ && exec sbt "run arg1") 
like image 85
Christopher Chiche Avatar answered Sep 18 '22 04:09

Christopher Chiche