diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-07-26 12:11:32 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-07-26 12:12:18 +0100 |
commit | 21e805b60be7d67df4e49be27c92bf25e71a2884 (patch) | |
tree | e8affa6129234a690813183742243777f47aa0bb | |
parent | bb3c3247f00cc9d0e28d3167378e33f8fac635ea (diff) | |
download | buildstream-21e805b60be7d67df4e49be27c92bf25e71a2884.tar.gz |
_sandboxbwrap.py: Ensure existence of the cwd
Before we were assuming the user would specify a cwd which exists,
now we dont care and just create it if it's not there.
-rw-r--r-- | buildstream/_sandboxbwrap.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/_sandboxbwrap.py b/buildstream/_sandboxbwrap.py index 12f3e3b09..11bbdc58b 100644 --- a/buildstream/_sandboxbwrap.py +++ b/buildstream/_sandboxbwrap.py @@ -253,6 +253,11 @@ class SandboxBwrap(Sandbox): with ExitStack() as stack: stack.enter_context(mount_map.mounted(self)) + # Ensure the cwd exists + if cwd is not None: + workdir = os.path.join(root_mount_source, cwd.lstrip(os.sep)) + os.makedirs(workdir, exist_ok=True) + # If we're interactive, we want to inherit our stdin, # otherwise redirect to /dev/null, ensuring process # disconnected from terminal. |