mirror of
https://github.com/flutter/packages.git
synced 2025-06-08 12:47:00 +08:00
[flutter_plugin_tools] Add 'main' support (#4474)
Treat `main` the same as `master` for branch-based switching, in preparation for switching the branch names in Flutter repositories. Also updates all of the tests that used `master` as the explicit base to use `main` instead; what the tests use is arbitrary, so they can be switched now even though the repo itself hasn't switched. Part of https://github.com/flutter/flutter/issues/90476
This commit is contained in:
@ -81,7 +81,8 @@ abstract class PluginCommand extends Command<void> {
|
||||
argParser.addFlag(_packagesForBranchArg,
|
||||
help:
|
||||
'This runs on all packages (equivalent to no package selection flag)\n'
|
||||
'on master, and behaves like --run-on-changed-packages on any other branch.\n\n'
|
||||
'on main (or master), and behaves like --run-on-changed-packages on '
|
||||
'any other branch.\n\n'
|
||||
'Cannot be combined with $_packagesArg.\n\n'
|
||||
'This is intended for use in CI.\n',
|
||||
hide: true);
|
||||
@ -301,7 +302,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
'only be used in a git repository.');
|
||||
throw ToolExit(exitInvalidArguments);
|
||||
} else {
|
||||
runOnChangedPackages = branch != 'master';
|
||||
runOnChangedPackages = branch != 'master' && branch != 'main';
|
||||
// Log the mode for auditing what was intended to run.
|
||||
print('--$_packagesForBranchArg: running on '
|
||||
'${runOnChangedPackages ? 'changed' : 'all'} packages');
|
||||
|
Reference in New Issue
Block a user