Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2159)

Unified Diff: recipe_modules/step/api.py

Issue 2875543002: [recipe_modules/step] do not set cwd if it is start_dir. (Closed)
Patch Set: fix take 2 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | recipe_modules/step/example.py » ('j') | recipe_modules/step/example.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/step/api.py
diff --git a/recipe_modules/step/api.py b/recipe_modules/step/api.py
index f9b7a52e6b2776f95e5ea93c30135a091bbd2ab7..cc7e9958d504ede45b2ead18114a09a9bea57f94 100644
--- a/recipe_modules/step/api.py
+++ b/recipe_modules/step/api.py
@@ -153,7 +153,6 @@ class StepApi(recipe_api.RecipeApiPlain):
command wrapper.
timeout: If supplied, the recipe engine will kill the step after the
specified number of seconds.
- cwd (str or None): absolute path to working directory for the command
allow_subannotations (bool): if True, lets the step emit its own
annotations. NOTE: Enabling this can cause some buggy behavior. Please
strongly consider using step_result.presentation instead. If you have
@@ -215,8 +214,9 @@ class StepApi(recipe_api.RecipeApiPlain):
name = "%s (%d)" % (name, step_count)
self._seen_steps.add(full_name)
- if 'cwd' not in kwargs:
- kwargs['cwd'] = self.get_from_context('cwd')
+ cwd = self.get_from_context('cwd')
+ if cwd is not None and cwd != self.m.path['start_dir']:
+ kwargs['cwd'] = cwd
kwargs['env'] = self.get_from_context('env', {})
if self._prefix_path:
ps = self.m.path.pathsep
« no previous file with comments | « no previous file | recipe_modules/step/example.py » ('j') | recipe_modules/step/example.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698