This repository was archived by the owner on Apr 4, 2025. It is now read-only.
File tree 4 files changed +21
-2
lines changed
packages/schematics/angular/application 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ export default function (options: ApplicationOptions): Rule {
94
94
mergeWith (
95
95
apply ( url ( './files' ) , [
96
96
options . minimal ? filter ( minimalPathFilter ) : noop ( ) ,
97
+ options . skipGit ? filter ( path => ! path . endsWith ( 'gitignore' ) ) : noop ( ) ,
97
98
template ( {
98
99
utils : stringUtils ,
99
100
'dot' : '.' ,
Original file line number Diff line number Diff line change @@ -91,4 +91,12 @@ describe('Application Schematic', () => {
91
91
const routingModuleContent = getFileContent ( tree , '/foo/src/app/app-routing.module.ts' ) ;
92
92
expect ( routingModuleContent ) . toMatch ( / R o u t e r M o d u l e .f o r R o o t \( r o u t e s \) / ) ;
93
93
} ) ;
94
+
95
+ it ( 'should handle the skip git flag' , ( ) => {
96
+ const options = { ...defaultOptions , skipGit : true } ;
97
+
98
+ const tree = schematicRunner . runSchematic ( 'application' , options ) ;
99
+ const files = tree . files ;
100
+ expect ( files . indexOf ( '/foo/.gitignore' ) ) . toEqual ( - 1 ) ;
101
+ } ) ;
94
102
} ) ;
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ export interface Schema {
25
25
/**
26
26
* Specifies the view encapsulation strategy.
27
27
*/
28
- viewEncapsulation ?: ( ' Emulated' | ' Native' | ' None' ) ;
28
+ viewEncapsulation ?: ( " Emulated" | " Native" | " None" ) ;
29
29
/**
30
30
* Specifies the change detection strategy.
31
31
*/
32
- changeDetection ?: ( ' Default' | ' OnPush' ) ;
32
+ changeDetection ?: ( " Default" | " OnPush" ) ;
33
33
version ?: string ;
34
34
routing ?: boolean ;
35
35
/**
@@ -44,6 +44,10 @@ export interface Schema {
44
44
* Skip creating spec files.
45
45
*/
46
46
skipTests ?: boolean ;
47
+ /**
48
+ * Skip initializing a git repository.
49
+ */
50
+ skipGit ?: boolean ;
47
51
/**
48
52
* Should create a minimal app.
49
53
*/
Original file line number Diff line number Diff line change 69
69
"default" : false ,
70
70
"alias" : " st"
71
71
},
72
+ "skipGit" : {
73
+ "description" : " Skip initializing a git repository." ,
74
+ "type" : " boolean" ,
75
+ "default" : false ,
76
+ "alias" : " sg"
77
+ },
72
78
"minimal" : {
73
79
"description" : " Should create a minimal app." ,
74
80
"type" : " boolean" ,
You can’t perform that action at this time.
0 commit comments