summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/_frontend/app.py4
-rw-r--r--tests/frontend/init.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py
index 2ee6a770f..331c35fe2 100644
--- a/buildstream/_frontend/app.py
+++ b/buildstream/_frontend/app.py
@@ -270,14 +270,14 @@ class App():
# Args:
# project_name (str): The project name, must be a valid symbol name
# format_version (int): The project format version, default is the latest version
- # element_directory (str): The subdirectory to store elements in, default is 'elements'
+ # element_path (str): The subdirectory to store elements in, default is 'elements'
# force (bool): Allow overwriting an existing project.conf
#
def init_project(self, project_name, format_version=BST_FORMAT_VERSION, element_path='elements', force=False):
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')
+ elements_path = os.path.join(directory, element_path)
try:
# Abort if the project.conf already exists, unless `--force` was specified in `bst init`
diff --git a/tests/frontend/init.py b/tests/frontend/init.py
index be7415cf0..8955ae395 100644
--- a/tests/frontend/init.py
+++ b/tests/frontend/init.py
@@ -37,6 +37,9 @@ def test_all_options(cli, tmpdir):
assert project_conf['format-version'] == str(2)
assert project_conf['element-path'] == 'ponies'
+ elements_dir = os.path.join(project, 'ponies')
+ assert os.path.isdir(elements_dir)
+
def test_no_project_name(cli, tmpdir):
result = cli.run(project=str(tmpdir), args=['init'])