Commit 7368f569 authored by Angelos Evripiotis's avatar Angelos Evripiotis Committed by Angelos Evripiotis
Browse files

_project::_find_project_dir: fix error message

Now that we are also looking for WORKSPACE_PROJECT_FILE, we should add
it to the error message. While we're there, also mention the directory
we are looking in - this could help scripters be clear about what went
wrong.

The new error message looks like this:

    Error loading project: None of ['project.conf', '.bstproject.yaml']
    found in '/src/temp/blah' or any of its parent directories
parent 14da6955
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -677,8 +677,9 @@ class Project():
    #
    def _find_project_dir(self, directory):
        workspace_element = None
        config_filenames = [_PROJECT_CONF_FILE, WORKSPACE_PROJECT_FILE]
        found_directory, filename = utils._search_upward_for_files(
            directory, [_PROJECT_CONF_FILE, WORKSPACE_PROJECT_FILE]
            directory, config_filenames
        )
        if filename == _PROJECT_CONF_FILE:
            project_directory = found_directory
@@ -691,8 +692,8 @@ class Project():
        else:
            raise LoadError(
                LoadErrorReason.MISSING_PROJECT_CONF,
                '{} not found in current directory or any of its parent directories'
                .format(_PROJECT_CONF_FILE))
                "None of {names} found in '{path}' or any of its parent directories"
                .format(names=config_filenames, path=directory))

        return project_directory, workspace_element