Use utils.FolderChanger() to temporarily change directory.

This commit is contained in:
Dhananjay Nakrani 2015-09-07 10:19:39 -07:00
Родитель ce6e614097
Коммит d7fe15534e
1 изменённых файлов: 1 добавлений и 8 удалений

Просмотреть файл

@ -258,16 +258,9 @@ class ServoBuilder(Builder):
return os.path.join(self.objdir(), 'release', 'servo')
def make(self):
# Remember cwd
cwd = os.getcwd()
# cd into servo's root directory. Requirement of 'mach build'
os.chdir(self.folder)
try:
with utils.FolderChanger(self.folder):
args = [os.path.join('.', 'mach'), 'build' ,'--release']
Run(args, self.env.get())
finally:
# Go back to the cwd
os.chdir(cwd)
def getBuilder(config, path):
# fingerprint the known builders