CdScope

A cd that optionally restores the previous directory.

Usage

Source

CdScope()

Returned by RunBuilder.cd. As a bare statement it just changes directory. As a with block it appends cd - on exit, so later commands resume where they were.

Parameter Attributes

builder: RunBuilder
path: str

Example

with r.cd(“/src/build”): … r.make(“install”) … # cd /src/build && make install && cd -