Files
Jake Macdonald c2dc8f62a3 Add current directory project generator
This makes iterating on things faster, with the downside of requiring a clean git tree
to avoid bashing over pending changes.

Change-Id: I5725c288f6f4f4665e9cd8cc8d91cb77d214df2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2026-01-05 09:08:53 -08:00

31 lines
738 B
Dart

// Copyright (c) 2025, 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';
/// Runs `git` with [args] in the specified [workingDirectory].
///
/// Throws a [StateError] if it has a non-zero exit code.
Future<ProcessResult> runGitCommand(
List<String> args,
Directory workingDirectory,
) async {
var result = await Process.run(
'git',
args,
workingDirectory: workingDirectory.path,
);
if (result.exitCode != 0) {
throw StateError('''
Error running `git ${args.join(' ')}`:
Stderr:
${result.stderr}
Stdout:
${result.stdout}''');
}
return result;
}