From a0a513006145833212c2c3ab83311e21f5ec012b Mon Sep 17 00:00:00 2001 From: Prabhjyot Singh Sodhi Date: Fri, 20 Feb 2015 20:39:31 +0530 Subject: [PATCH] ./mach cargo now cd's to servo dir if in root Fixes #4976 --- python/servo/devenv_commands.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index 76f4a5e0bd3..cab3f7ba81f 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -1,5 +1,5 @@ from __future__ import print_function, unicode_literals -from os import path +from os import path, getcwd import subprocess @@ -23,7 +23,12 @@ class MachCommands(CommandBase): def cargo(self, params): if not params: params = [] - return subprocess.call(["cargo"] + params, + + if self.context.topdir == getcwd(): + with cd(path.join('components', 'servo')): + return subprocess.call(["cargo"] + params, + env=self.build_env()) + return subprocess.call(['cargo'] + params, env=self.build_env()) @Command('update-cargo',