summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-12-06 17:41:33 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-12-11 16:15:19 +0000
commit7cf8334380a3454842b4263112a54c5cca4765f5 (patch)
tree33ce110f73366c8bfe06aaf60e6ed36e5a8a2c1c
parente564251b3a689c7dac74c754440f0dd4bcd6ca97 (diff)
downloadbuildstream-7cf8334380a3454842b4263112a54c5cca4765f5.tar.gz
_context.py: Store the directory buildstream was invoked on
-rw-r--r--buildstream/_context.py6
-rw-r--r--buildstream/_frontend/app.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py
index 5211fe54d..9a12b2b27 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -47,9 +47,12 @@ from .plugin import _plugin_lookup
# verbosity levels and basically anything pertaining to the context
# in which BuildStream was invoked.
#
+# Args:
+# directory (str): The directory that buildstream was invoked in
+#
class Context():
- def __init__(self):
+ def __init__(self, directory=None):
# Filename indicating which configuration file was used, or None for the defaults
self.config_origin = None
@@ -148,6 +151,7 @@ class Context():
self._log_handle = None
self._log_filename = None
self._cascache = None
+ self._directory = directory
# load()
#
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py
index 4094eec17..87b85cd37 100644
--- a/buildstream/_frontend/app.py
+++ b/buildstream/_frontend/app.py
@@ -164,7 +164,7 @@ class App():
# Load the Context
#
try:
- self.context = Context()
+ self.context = Context(directory)
self.context.load(config)
except BstError as e:
self._error_exit(e, "Error loading user configuration")