commands: propertize WestCommand.requires_installation

This makes it impossible for these two fields to get out of sync.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2021-01-31 11:38:42 -08:00 committed by Marti Bolivar
parent 4808c626e2
commit 9feb713942
1 changed files with 5 additions and 1 deletions

View File

@ -104,10 +104,14 @@ class WestCommand(ABC):
self.requires_workspace = requires_installation
else:
self.requires_workspace = requires_workspace
self.requires_installation = self.requires_workspace
self.topdir = None
self.manifest = None
@property
def requires_installation(self) -> bool:
'''Deprecated property alias for self.requires_workspace.'''
return self.requires_workspace
def run(self, args, unknown, topdir, manifest=None):
'''Run the command.