hvesalai / emacs-sbt-mode

An emacs mode for interacting with scala sbt and projects
GNU General Public License v3.0
125 stars 38 forks source link

How can I force sbt to start from current directory? #131

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello, I am quite new to Scala, and having fun playing with ensime and sbt.

However, when I enter M-x sbt-start, the consequences are sometimes unpredictable.

I want to open sbt with the project where open file in current buffer belongs to, but it often starts

sbt from $HOME. I am not sure how sbt-start decides where to run sbt.

How can I improve these unexpected behaviors, for example passing path to desired project?

Thank you.

hvesalai commented 6 years ago

https://github.com/ensime/emacs-sbt-mode/blob/master/sbt-mode-project.el#L26

It is traversing to your home because you have an sbt project there, i.e. you have executed sbt from your home and it has created the project directory or you have some *.sbt files in it. Remove those, or alternatively have a clean directory between your home and your actual project directory.