mirror of https://github.com/sbt/sbt.git
Add fancier `shellPrompt` by default, also better arg names
This commit is contained in:
parent
9ca86725b5
commit
f51aad4b5b
|
|
@ -26,6 +26,7 @@ object DefaultOptions {
|
|||
import Opts._
|
||||
import Path._
|
||||
import BuildPaths.{getGlobalBase, getGlobalSettingsDirectory}
|
||||
import Project.{Setting, extract}
|
||||
|
||||
def javac: Seq[String] = compile.encoding("UTF-8")
|
||||
def scalac: Seq[String] = compile.encoding("UTF-8")
|
||||
|
|
@ -34,6 +35,9 @@ object DefaultOptions {
|
|||
|
||||
@deprecated("Use `credentials(State)` instead to make use of configuration path dynamically configured via `Keys.globalSettingsDirectory`; relying on ~/.ivy2 is not recommended anymore.", "0.12.0")
|
||||
def credentials: Credentials = Credentials(userHome / ".ivy2" / ".credentials")
|
||||
def credentials(s: State): Credentials = Credentials(getGlobalSettingsDirectory(s, getGlobalBase(s)) / ".credentials")
|
||||
def addCredentials: Project.Setting[_] = Keys.credentials <+= Keys.state map credentials
|
||||
def credentials(state: State): Credentials = Credentials(getGlobalSettingsDirectory(state, getGlobalBase(state)) / ".credentials")
|
||||
def addCredentials: Setting[_] = Keys.credentials <+= Keys.state map credentials
|
||||
|
||||
def shellPrompt(version: String): State => String = s => "%s:%s:%s> ".format(s.configuration.provider.id.name, extract(s).currentProject.id, version)
|
||||
def setupShellPrompt: Setting[_] = Keys.shellPrompt <<= Keys.version apply shellPrompt
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue