From affa4b43443a980ff2e80441a9e340801ccc8159 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 29 Jan 2017 11:00:59 +0100 Subject: Reading version tag from repo --- src/GitRepo.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/GitRepo.js') diff --git a/src/GitRepo.js b/src/GitRepo.js index 57858aa..d7e19a7 100644 --- a/src/GitRepo.js +++ b/src/GitRepo.js @@ -1,5 +1,15 @@ -function repoVersion() { - console.log("testing"); - return "0.0.0"; +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; } - -- cgit v1.2.1