diff options
-rw-r--r-- | python/servo/devenv_commands.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index 199471a6023..5b4e14c1e3e 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -1,4 +1,5 @@ from __future__ import print_function, unicode_literals +from os import path import subprocess @@ -8,7 +9,7 @@ from mach.decorators import ( Command, ) -from servo.command_base import CommandBase +from servo.command_base import CommandBase, cd @CommandProvider @@ -24,6 +25,24 @@ class MachCommands(CommandBase): return subprocess.call(["cargo"] + params, env=self.build_env()) + @Command('update-cargo', + description='Update Cargo dependencies', + category='devenv', + allow_all_args=True) + @CommandArgument( + 'params', default=None, nargs='...', + help='Command-line arguments to be passed through to cargo update') + def update_cargo(self, params): + cargo_paths = [path.join('.'), + path.join('ports', 'cef'), + path.join('ports', 'android', 'glut_app')] + + for cargo_path in cargo_paths: + with cd(cargo_path): + print(cargo_path) + subprocess.call(["cargo", "update"] + params, + env=self.build_env()) + @Command('rustc', description='Run the Rust compiler', category='devenv', |