| Index: recipe_modules/context/examples/full.py
|
| diff --git a/recipe_modules/context/examples/full.py b/recipe_modules/context/examples/full.py
|
| index 960ef0ee6a63bb2fc7943b1416be1dcb57080eef..6df7378cf1507dbee859b250223f93e3bcee4ab5 100644
|
| --- a/recipe_modules/context/examples/full.py
|
| +++ b/recipe_modules/context/examples/full.py
|
| @@ -21,14 +21,24 @@ def RunSteps(api):
|
| api.step('default step', ['bash', '-c', 'echo default!'])
|
|
|
| # can change cwd
|
| - api.step('mk subdir', ['mkdir', 'subdir'])
|
| + api.step('mk subdir', ['mkdir', '-p', 'subdir'])
|
| with api.context(cwd=api.path['start_dir'].join('subdir')):
|
| api.step('subdir step', ['bash', '-c', 'pwd'])
|
| api.step('other subdir step', ['bash', '-c', 'echo hi again!'])
|
|
|
| - # can set envvars
|
| - with api.context(env={'HELLO': 'WORLD', 'HOME': None}):
|
| - api.step('env step', ['bash', '-c', 'echo $HELLO; echo $HOME'])
|
| + # can set envvars, and path prefix/suffix.
|
| + with api.context(env={'FOO': 'bar'}):
|
| + api.step('env step', ['bash', '-c', 'echo $FOO'])
|
| +
|
| + pants = api.path['start_dir'].join('pants')
|
| + shirt = api.path['start_dir'].join('shirt')
|
| + with api.context.path_prefix('FOO', pants, shirt):
|
| + api.step('env step with prefix and suffix',
|
| + ['bash', '-c', 'echo $FOO'])
|
| +
|
| + with api.context.path_remove('FOO', shirt):
|
| + api.step('env with path removal',
|
| + ['bash', '-c', 'echo $FOO'])
|
|
|
| # %-formats are errors (for now). Double-% escape them.
|
| bad_examples = ['%format', '%s']
|
|
|