`sbt run` 从项目目录外 [英] `sbt run` from outside the project directory

查看:31
本文介绍了`sbt run` 从项目目录外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想运行我的 Scala 项目时,我 cd 到项目目录并执行

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?

推荐答案

我的回答受到这个更普遍的问题的启发:如何从当前的 Linux shell 运行具有不同工作目录的程序?

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")

(cd myPath/ && exec sbt "run arg1")

这篇关于`sbt run` 从项目目录外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆