aboutsummaryrefslogtreecommitdiff
path: root/stage2/GitVersion.scala
diff options
context:
space:
mode:
Diffstat (limited to 'stage2/GitVersion.scala')
-rw-r--r--stage2/GitVersion.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/stage2/GitVersion.scala b/stage2/GitVersion.scala
new file mode 100644
index 0000000..3bdcba6
--- /dev/null
+++ b/stage2/GitVersion.scala
@@ -0,0 +1,9 @@
+package cbt
+import java.net.URL
+import scala.language.postfixOps
+import scala.sys.process._
+
+trait GitVersion extends BaseBuild {
+ def version: String =
+ (s"git -C $projectDirectory describe --always --dirty=-SNAPSHOT --match v[0-9].*" !!).tail.trim
+}