mirror of
https://github.com/servo/servo.git
synced 2025-06-09 00:53:26 +00:00
Remove ./mach cargo
.
Not all cargo subcommands take `--manifest-path`. Use plain `cargo` instead (rustup reads the `rust-toolchain` file) or consider adding new mach sub-commands.
This commit is contained in:
parent
aa5e5596c0
commit
d9dbcd52c3
1 changed files with 9 additions and 22 deletions
|
@ -31,7 +31,13 @@ from servo.util import get_static_rust_lang_org_dist, get_urlopen_kwargs
|
|||
|
||||
@CommandProvider
|
||||
class MachCommands(CommandBase):
|
||||
def run_cargo(self, params, check=False):
|
||||
@Command('check',
|
||||
description='Run "cargo check"',
|
||||
category='devenv')
|
||||
@CommandArgument(
|
||||
'params', default=None, nargs='...',
|
||||
help="Command-line arguments to be passed through to cargo check")
|
||||
def check(self, params):
|
||||
if not params:
|
||||
params = []
|
||||
|
||||
|
@ -39,8 +45,7 @@ class MachCommands(CommandBase):
|
|||
self.ensure_clobbered()
|
||||
env = self.build_env()
|
||||
|
||||
if check:
|
||||
params = ['check'] + params
|
||||
params = ['check'] + params
|
||||
|
||||
self.add_manifest_path(params)
|
||||
|
||||
|
@ -50,29 +55,11 @@ class MachCommands(CommandBase):
|
|||
|
||||
notify_build_done(self.config, elapsed, status == 0)
|
||||
|
||||
if check and status == 0:
|
||||
if status == 0:
|
||||
print('Finished checking, binary NOT updated. Consider ./mach build before ./mach run')
|
||||
|
||||
return status
|
||||
|
||||
@Command('cargo',
|
||||
description='Run Cargo',
|
||||
category='devenv')
|
||||
@CommandArgument(
|
||||
'params', default=None, nargs='...',
|
||||
help="Command-line arguments to be passed through to Cargo")
|
||||
def cargo(self, params):
|
||||
return self.run_cargo(params)
|
||||
|
||||
@Command('check',
|
||||
description='Run "cargo check"',
|
||||
category='devenv')
|
||||
@CommandArgument(
|
||||
'params', default=None, nargs='...',
|
||||
help="Command-line arguments to be passed through to cargo check")
|
||||
def check(self, params):
|
||||
return self.run_cargo(params, check=True)
|
||||
|
||||
@Command('cargo-update',
|
||||
description='Same as update-cargo',
|
||||
category='devenv')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue