bf96a722bc
First of we apply the wanted lints etc we prefer. This includes but isn't limited to using types (i.e. no "var") and being explicit about creation (i.e. no missing "new"). Change-Id: I516bccdac9760221ea5311af4567466bb4a65c77 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341960 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
19 lines
595 B
Dart
19 lines
595 B
Dart
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'dart:io';
|
|
|
|
String computeRepoDir() {
|
|
ProcessResult result = Process.runSync(
|
|
'git', ['rev-parse', '--show-toplevel'],
|
|
runInShell: true,
|
|
workingDirectory: new File.fromUri(Platform.script).parent.path);
|
|
return (result.stdout as String).trim();
|
|
}
|
|
|
|
Uri computeRepoDirUri() {
|
|
String dirPath = computeRepoDir();
|
|
return new Directory(dirPath).uri;
|
|
}
|