From 16e8146971b2c884f39a8fae6711d6ddb7b23f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Thu, 20 Nov 2014 10:46:22 +0100 Subject: [PATCH] Added commit sha in phar version --- Cli/Application.php | 12 ++++++++++++ box.json.dist => box.json | 1 + 2 files changed, 13 insertions(+) rename box.json.dist => box.json (88%) diff --git a/Cli/Application.php b/Cli/Application.php index 886a026..643edcc 100644 --- a/Cli/Application.php +++ b/Cli/Application.php @@ -65,6 +65,18 @@ public function getApi() return $this->api; } + public function getLongVersion() + { + $version = parent::getLongVersion().' by SensioLabs'; + $commit = '@git-commit@'; + + if ('@'.'git-commit@' !== $commit) { + $version .= ' ('.substr($commit, 0, 7).')'; + } + + return $version; + } + protected function getDefaultHelperSet() { $helperSet = parent::getDefaultHelperSet(); diff --git a/box.json.dist b/box.json similarity index 88% rename from box.json.dist rename to box.json index 2276fe2..942b991 100644 --- a/box.json.dist +++ b/box.json @@ -4,6 +4,7 @@ "output": "build/insight.phar", "stub": true, "directories": ["."], + "git-commit": "git-commit", "map": [ { "Cli": "SensioLabs/Insight/Cli" }, { "Sdk": "SensioLabs/Insight/Sdk" }