async function searchForBootVersion()

in src/handler/AddStartersHandler.ts [115:137]


async function searchForBootVersion(uri: vscode.Uri): Promise<string> {
    const content: Uint8Array = await vscode.workspace.fs.readFile(uri);
    const { project: projectNode } = await readXmlContent(content.toString());
    const bootVersion: string = getBootVersion(projectNode);
    if (bootVersion) {
        return bootVersion;
    }

    // search recursively in parent pom
    const relativePath = getParentRelativePath(projectNode);
    if (relativePath) {
        const newPath = path.join(path.dirname(uri.path), relativePath);
        let newUri = uri.with({path: newPath});

        if (await isDirectory(newUri)) {
            newUri = uri.with({path: path.join(newPath, "pom.xml")});
        }
        if (await pathExists(newUri)) {
            return await searchForBootVersion(newUri);
        }
    }
    return undefined;
}