Bug 1585828 - Replace is_firefox_or_android condition with has_build condition on mach run/mach install r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D47992

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Geoff Lankow 2019-10-04 13:20:07 +00:00
parent 2322d61c8b
commit 68b84bf193
2 changed files with 8 additions and 2 deletions

View File

@ -957,6 +957,12 @@ class MachCommandConditions(object):
"""Must have a Firefox or Android build."""
return MachCommandConditions.is_firefox(cls) or MachCommandConditions.is_android(cls)
@staticmethod
def has_build(cls):
"""Must have a build."""
return (MachCommandConditions.is_firefox_or_android(cls) or
MachCommandConditions.is_thunderbird(cls))
@staticmethod
def is_hg(cls):
"""Must have a mercurial source checkout."""

View File

@ -677,7 +677,7 @@ class Install(MachCommandBase):
"""Install a package."""
@Command('install', category='post-build',
conditions=[conditions.is_firefox_or_android],
conditions=[conditions.has_build],
description='Install the package on the machine (or device in the case of Android).')
@CommandArgument('--verbose', '-v', action='store_true',
help='Print verbose output when installing.')
@ -799,7 +799,7 @@ class RunProgram(MachCommandBase):
"""Run the compiled program."""
@Command('run', category='post-build',
conditions=[conditions.is_firefox_or_android],
conditions=[conditions.has_build],
parser=setup_run_parser,
description='Run the compiled program, possibly under a debugger or DMD.')
def run(self, **kwargs):