diff options
Diffstat (limited to 'buildstream/_frontend/app.py')
-rw-r--r-- | buildstream/_frontend/app.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py index c32f8c90b..3bcb0d962 100644 --- a/buildstream/_frontend/app.py +++ b/buildstream/_frontend/app.py @@ -343,6 +343,7 @@ class App(): directory = self._main_options['directory'] directory = os.path.abspath(directory) project_path = os.path.join(directory, 'project.conf') + elements_path = os.path.join(directory, 'elements') try: # Abort if the project.conf already exists, unless `--force` was specified in `bst init` @@ -371,6 +372,13 @@ class App(): except IOError as e: raise AppError("Error creating project directory {}: {}".format(directory, e)) from e + # Create the elements sub-directory if it doesnt exist + try: + os.makedirs(elements_path, exist_ok=True) + except IOError as e: + raise AppError("Error creating elements sub-directory {}: {}" + .format(elements_path, e)) from e + # Dont use ruamel.yaml here, because it doesnt let # us programatically insert comments or whitespace at # the toplevel. |