workPackage property

Package workPackage

The "focus" package that the current command should act upon.

It will be the package in the nearest parent directory to workingDir. Example: if a workspace looks like this:

foo/ pubspec.yaml # contains workspace: [- 'bar'] bar/ pubspec.yaml # contains resolution: workspace`.

Running pub add in foo/bar will have bar as workPackage, and add dependencies to foo/bar/pubspec.yaml.

Running pub add in foo will have foo as workPackage, and add dependencies to foo/pubspec.yaml.

Implementation

Package get workPackage => _getPackages.work;