diff --git a/src/main/scala/com/typesafe/sbt/SbtGit.scala b/src/main/scala/com/typesafe/sbt/SbtGit.scala index c607388..669c24e 100644 --- a/src/main/scala/com/typesafe/sbt/SbtGit.scala +++ b/src/main/scala/com/typesafe/sbt/SbtGit.scala @@ -3,6 +3,7 @@ package com.typesafe.sbt import sbt._ import Keys._ import git.{ConsoleGitRunner, DefaultReadableGit, GitRunner, JGitRunner, ReadableGit} +import scala.Console import sys.process.Process /** This plugin has all the basic 'git' functionality for other plugins. */ @@ -95,14 +96,16 @@ object SbtGit { val prompt: State => String = { state => val extracted = Project.extract(state) - val reader = extracted get GitKeys.gitReader - val dir = extracted get baseDirectory - val name = extracted get Keys.name + val dir = extracted.get(baseDirectory) + val name = extracted.get(Keys.name) + val end = s"${Console.BLUE}> ${Console.RESET}" if (isGitRepo(dir)) { - val branch = reader.withGit(_.branch) - name + "(" + branch + ")> " + val reader = extracted.get(GitKeys.gitReader) + val branchName = reader.withGit(_.branch) + val branchColored = s"${Console.GREEN}[$branchName]${Console.RESET}" + name + branchColored + end } else { - name + "> " + name + end } } }