Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
set tool exit to 1 and return pubspec
  • Loading branch information
bparrishMines committed Feb 16, 2021
commit 4d0f7fbcca4807901af5c006b6883492d600c67b
7 changes: 2 additions & 5 deletions script/tool/lib/src/publish_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PublishCheckCommand extends PluginCommand {
final Colorize colorizedError = Colorize('$error\n$joinedFailedPackages')
..red();
print(colorizedError);
throw ToolExit(64);
throw ToolExit(1);
}

final Colorize passedMessage =
Expand All @@ -53,17 +53,14 @@ class PublishCheckCommand extends PluginCommand {
Pubspec tryParsePubspec(Directory package) {
final File pubspecFile = package.childFile('pubspec.yaml');

Pubspec pubspec;
try {
pubspec = Pubspec.parse(pubspecFile.readAsStringSync());
return Pubspec.parse(pubspecFile.readAsStringSync());
} on Exception catch (exception) {
print(
'Failed to parse `pubspec.yaml` at ${pubspecFile.path}: $exception}',
);
return null;
}

return pubspec;
}

Future<bool> passesPublishCheck(Directory package) async {
Expand Down