[flutter_plugin_tools] Simplify filesystem usage (#4014)

- Replaces most explicit use of `fileSystem` with path construction using the `child*` utility methods
- Removes explicit passing of a filesystem to the commands; we're already passing a `Directory` for the
  root where the tool operates, and we should never be using a different filesystem than that directory's
  filesystem, so passing it was both redundant, and a potential source of test bugs.
This commit is contained in:
stuartmorgan
2021-06-05 10:32:24 -07:00
committed by GitHub
parent 533596f798
commit bb0a1ea161
34 changed files with 177 additions and 231 deletions

View File

@ -21,13 +21,12 @@ import 'common.dart';
class PublishCheckCommand extends PluginCommand {
/// Creates an instance of the publish command.
PublishCheckCommand(
Directory packagesDir,
FileSystem fileSystem, {
Directory packagesDir, {
ProcessRunner processRunner = const ProcessRunner(),
this.httpClient,
}) : _pubVersionFinder =
PubVersionFinder(httpClient: httpClient ?? http.Client()),
super(packagesDir, fileSystem, processRunner: processRunner) {
super(packagesDir, processRunner: processRunner) {
argParser.addFlag(
_allowPrereleaseFlag,
help: 'Allows the pre-release SDK warning to pass.\n'