(
workspace: workspaces.WorkspaceDefinition,
options: { project?: string | undefined; path?: string | undefined },
)
| 3 | import { ProjectDefinitionCollection } from "@angular-devkit/core/src/workspace/definitions"; |
| 4 | |
| 5 | export function getProjectPath( |
| 6 | workspace: workspaces.WorkspaceDefinition, |
| 7 | options: { project?: string | undefined; path?: string | undefined }, |
| 8 | ) { |
| 9 | const project = getProject(workspace, options); |
| 10 | |
| 11 | if (project?.root.substr(-1) === '/') { |
| 12 | project.root = project.root.substr(0, project.root.length - 1); |
| 13 | } |
| 14 | |
| 15 | if (options.path === undefined) { |
| 16 | const projectDirName = project?.extensions.projectType === 'application' |
| 17 | ? 'app' |
| 18 | : 'lib'; |
| 19 | |
| 20 | const sourceRoot = getSourceRoot(project?.sourceRoot); |
| 21 | return `${project?.root ? `/${project.root}` : ''}/${sourceRoot}/${projectDirName}`; |
| 22 | } |
| 23 | |
| 24 | return options.path; |
| 25 | } |
| 26 | |
| 27 | export function getProject( |
| 28 | workspace: workspaces.WorkspaceDefinition, |
no test coverage detected