add the engine revision to --version

This commit is contained in:
Devon Carew
2016-01-29 10:45:59 -08:00
parent 1b75de1b16
commit 864b7f47d7
3 changed files with 25 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../artifacts.dart';
import '../base/process.dart';
String getVersion(String flutterRoot) {
@@ -20,5 +21,12 @@ String getVersion(String flutterRoot) {
String revision = runSync([
'git', 'log', '-n', '1', '--pretty=format:%H (%ar)'
], workingDirectory: flutterRoot).trim();
return 'Flutter\nRepository: $repository\nBranch: $upstream\nRevision: $revision';
String version = 'Flutter from $repository (on $upstream)\nflutter revision: $revision';
String engineRevision = ArtifactStore.engineRevision;
if (engineRevision != null)
version += '\nengine revision : $engineRevision';
return version;
}