Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolveProjectBasePath could not find source root when directory… #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/utils/resolve-project-base-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,24 @@ export function resolveProjectBasePath(projectName?: string): {
} {
let projectPath = '';

let projectConfig;
if (projectName) {
projectPath = normalizedGlob(`**/${projectName}`)[0];
// look for all project.json files and find the project.json that contains
// { name: "<projectName>" ... }
const projectConfigs = normalizedGlob(`**/${projectConfigFile}`);
for(const p of projectConfigs) {
const config = searchConfig(projectConfigFile, p);
if(config.name === projectName) {
projectConfig = config;
break;
}
}
} else {
projectConfig = searchConfig(projectConfigFile, projectPath);
}
Comment on lines +47 to 61
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this into resolveProjectConfig and merge 👍


const angularConfig = searchConfig(angularConfigFile, projectPath);
const workspaceConfig = searchConfig(workspaceConfigFile, projectPath);
const projectConfig = searchConfig(projectConfigFile, projectPath);

if (!angularConfig && !workspaceConfig && !projectConfig) {
logNotFound([...angularConfigFile, workspaceConfigFile, projectConfigFile]);
Expand Down