Files
sdk/pkg/frontend_server/test/io_utils.dart
T
Jens Johansen bf96a722bc [frontend_server] CFE team takes ownership of package:frontend_server
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>
2023-12-19 10:38:28 +00:00

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;
}