mirror of
https://github.com/flutter/packages.git
synced 2025-06-07 11:59:30 +08:00
[tool] Use 'flutter pub get' for Flutter packages (#4397)
Extracts common logic for running `pub get`, and switches commands to use it. The common logic always uses `flutter pub get` for Flutter packages, rather than `dart pub get`, since the latter will fail if someone has a non-Flutter `dart` in their path before `flutter` (e.g., Dart team members contributing PRs).
This commit is contained in:
@ -14,6 +14,7 @@ import 'package:yaml_edit/yaml_edit.dart';
|
||||
import 'common/core.dart';
|
||||
import 'common/package_looping_command.dart';
|
||||
import 'common/process_runner.dart';
|
||||
import 'common/pub_utils.dart';
|
||||
import 'common/repository_package.dart';
|
||||
|
||||
/// A command to update .md code excerpts from code files.
|
||||
@ -81,10 +82,7 @@ class UpdateExcerptsCommand extends PackageLoopingCommand {
|
||||
|
||||
try {
|
||||
// Ensure that dependencies are available.
|
||||
final int pubGetExitCode = await processRunner.runAndStream(
|
||||
'dart', <String>['pub', 'get'],
|
||||
workingDir: example.directory);
|
||||
if (pubGetExitCode != 0) {
|
||||
if (!await runPubGet(example, processRunner, platform)) {
|
||||
return PackageResult.fail(
|
||||
<String>['Unable to get script dependencies']);
|
||||
}
|
||||
|
Reference in New Issue
Block a user