mirror of
https://github.com/servo/servo.git
synced 2025-06-08 08:33:26 +00:00
Avoid #12321 by creating environment before switching directories.
This commit is contained in:
parent
906b7b33ef
commit
a2bc9d7775
1 changed files with 7 additions and 6 deletions
|
@ -174,23 +174,24 @@ class MachCommands(CommandBase):
|
||||||
description='upgrade wptrunner.',
|
description='upgrade wptrunner.',
|
||||||
category='devenv')
|
category='devenv')
|
||||||
def upgrade_wpt_runner(self):
|
def upgrade_wpt_runner(self):
|
||||||
|
env = self.build_env()
|
||||||
with cd(path.join(self.context.topdir, 'tests', 'wpt', 'harness')):
|
with cd(path.join(self.context.topdir, 'tests', 'wpt', 'harness')):
|
||||||
code = call(["git", "init"], env=self.build_env())
|
code = call(["git", "init"], env=env)
|
||||||
if code:
|
if code:
|
||||||
return code
|
return code
|
||||||
# No need to report an error if this fails, as it will for the first use
|
# No need to report an error if this fails, as it will for the first use
|
||||||
call(["git", "remote", "rm", "upstream"], env=self.build_env())
|
call(["git", "remote", "rm", "upstream"], env=env)
|
||||||
code = call(
|
code = call(
|
||||||
["git", "remote", "add", "upstream", "https://github.com/w3c/wptrunner.git"], env=self.build_env())
|
["git", "remote", "add", "upstream", "https://github.com/w3c/wptrunner.git"], env=env)
|
||||||
if code:
|
if code:
|
||||||
return code
|
return code
|
||||||
code = call(["git", "fetch", "upstream"], env=self.build_env())
|
code = call(["git", "fetch", "upstream"], env=env)
|
||||||
if code:
|
if code:
|
||||||
return code
|
return code
|
||||||
code = call(["git", "reset", "--hard", "remotes/upstream/master"], env=self.build_env())
|
code = call(["git", "reset", "--hard", "remotes/upstream/master"], env=env)
|
||||||
if code:
|
if code:
|
||||||
return code
|
return code
|
||||||
code = call(["rm", "-rf", ".git"], env=self.build_env())
|
code = call(["rm", "-rf", ".git"], env=env)
|
||||||
if code:
|
if code:
|
||||||
return code
|
return code
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue