MCPcopy Index your code
hub / github.com/angular/angular-cli / getProjectByCwd

Function getProjectByCwd

packages/angular/cli/src/utilities/config.ts:305–317  ·  view source on GitHub ↗
(workspace: AngularWorkspace)

Source from the content-addressed store, hash-verified

303}
304
305export function getProjectByCwd(workspace: AngularWorkspace): string | null {
306 if (workspace.projects.size === 1) {
307 // If there is only one project, return that one.
308 return Array.from(workspace.projects.keys())[0];
309 }
310
311 const project = findProjectByPath(workspace, process.cwd());
312 if (project) {
313 return project;
314 }
315
316 return null;
317}
318
319export async function getConfiguredPackageManager(): Promise<PackageManager | null> {
320 const getPackageManager = (source: json.JsonValue | undefined): PackageManager | null => {

Callers 7

getSchematicCollectionsFunction · 0.90
getProjectNameFunction · 0.90
getProjectNamesByTargetFunction · 0.90
getSchematicDefaultsFunction · 0.85
isWarningEnabledFunction · 0.85

Calls 3

findProjectByPathFunction · 0.85
fromMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected