aboutsummaryrefslogtreecommitdiff
path: root/tools/qbs/GitRepo.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qbs/GitRepo.js')
-rw-r--r--tools/qbs/GitRepo.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/qbs/GitRepo.js b/tools/qbs/GitRepo.js
new file mode 100644
index 0000000..d7e19a7
--- /dev/null
+++ b/tools/qbs/GitRepo.js
@@ -0,0 +1,15 @@
+var Process = loadExtension("qbs.Process")
+
+function read(workingDirectory) {
+ var git = new Process();
+ git.setWorkingDirectory(workingDirectory);
+
+ var meta = Object.create(null);
+ git.exec("git", ["describe", "--abbrev=0", "--tag"], true);
+ meta.version = git.readLine();
+
+ git.exec("git", ["describe", "--tag"], true);
+ meta.describe = git.readLine();
+
+ return meta;
+}