File tree Expand file tree Collapse file tree
packages/schematics/src/lib/swagger Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { join , Path } from '@angular-devkit/core' ;
1+ import { join , Path , strings } from '@angular-devkit/core' ;
22import { chain , Rule , Tree } from '@angular-devkit/schematics' ;
33import {
44 addDecoratorToClassProp ,
@@ -200,11 +200,16 @@ function updateMain(project: string) {
200200}
201201
202202export function swagger ( options : { path ?: string } ) : Rule {
203- const projectPath = options . path || '.' ;
204- return chain ( [
205- updatePackageJson ( projectPath ) ,
206- updateMain ( projectPath ) ,
207- updateNestCliJson ( projectPath ) ,
208- updateBaseEntity ( projectPath ) ,
209- ] ) ;
203+ return ( ) : any => {
204+ if ( ! options . path ) {
205+ options . path = '.' ;
206+ }
207+ options . path = strings . dasherize ( options . path ) ;
208+ return chain ( [
209+ updatePackageJson ( options . path ) ,
210+ updateMain ( options . path ) ,
211+ updateNestCliJson ( options . path ) ,
212+ updateBaseEntity ( options . path ) ,
213+ ] ) ;
214+ } ;
210215}
You can’t perform that action at this time.
0 commit comments