Created
September 10, 2018 19:14
-
-
Save jonbcampos/b972d9c6d0255b2649c6b40714f19ce6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {getWorkspace} from '@schematics/angular/utility/config'; | |
import {buildDefaultPath} from '@schematics/angular/utility/project'; | |
import {parseName} from '@schematics/angular/utility/parse-name'; | |
import {Tree} from '@angular-devkit/schematics'; | |
export function setupOptions(host: Tree, options: any): Tree { | |
const workspace = getWorkspace(host); | |
if (!options.project) { | |
options.project = Object.keys(workspace.projects)[0]; | |
} | |
const project = workspace.projects[options.project]; | |
if (options.path === undefined) { | |
options.path = buildDefaultPath(project); | |
} | |
const parsedPath = parseName(options.path, options.name); | |
options.name = parsedPath.name; | |
options.path = parsedPath.path; | |
return host; | |
} |
for everyone that want to use this code, this worked for me with version (@schematics/angular@9.1.0)
in your command line:
npm uninstall @schematics/angular
npm install @schematics/angular@9.1.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Argument of type 'WorkspaceProject' is not assignable to parameter of type 'WorkspaceProject<ProjectType.Application>'. Type 'ProjectType' is not assignable to type 'ProjectType.Application'.