File tree 1 file changed +14
-6
lines changed
packages/create-react-app
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,12 @@ function writeWarningFile() {
68
68
ourPackageInNodeModules ,
69
69
'given-deprecation-warning'
70
70
) ;
71
- fs . writeFileSync ( warningFilePath , 'true' ) ;
71
+
72
+ if ( fs . existsSync ( ourPackageInNodeModules ) ) {
73
+ fs . writeFileSync ( warningFilePath , 'true' ) ;
74
+ return true ;
75
+ }
76
+ return false ;
72
77
}
73
78
74
79
let projectName ;
@@ -83,11 +88,14 @@ function init() {
83
88
console . log (
84
89
chalk . underline ( 'https://react.dev/learn/start-a-new-react-project' )
85
90
) ;
86
- console . log ( '' ) ;
87
- console . log (
88
- chalk . grey ( 'This error message will only be shown once per install.' )
89
- ) ;
90
- writeWarningFile ( ) ;
91
+
92
+ const wroteWarningFile = writeWarningFile ( ) ;
93
+ if ( wroteWarningFile ) {
94
+ console . log ( '' ) ;
95
+ console . log (
96
+ chalk . grey ( 'This error message will only be shown once per install.' )
97
+ ) ;
98
+ }
91
99
}
92
100
93
101
const program = new commander . Command ( packageJson . name )
You can’t perform that action at this time.
0 commit comments