@@ -58,10 +58,10 @@ function writeFileIfDoesNotExist(path, data) {
58
58
if ( err ) {
59
59
return reject ( err ) ;
60
60
}
61
- resolve ( data ) ;
61
+ resolve ( true ) ;
62
62
} ) ;
63
63
} else {
64
- resolve ( data ) ;
64
+ resolve ( false ) ;
65
65
}
66
66
} ) ;
67
67
} ) ;
@@ -75,7 +75,7 @@ function writeInFileIfNotPresent(path, contentToAssert, contentToAppend) {
75
75
if ( err ) {
76
76
return reject ( err ) ;
77
77
}
78
- resolve ( contentToAppend ) ;
78
+ resolve ( true ) ;
79
79
} ) ;
80
80
} else {
81
81
fs . readFile ( path , ( err , existingContent ) => {
@@ -87,10 +87,10 @@ function writeInFileIfNotPresent(path, contentToAssert, contentToAppend) {
87
87
if ( err ) {
88
88
return reject ( err ) ;
89
89
}
90
- resolve ( contentToAppend ) ;
90
+ resolve ( true ) ;
91
91
} ) ;
92
92
} else {
93
- resolve ( contentToAppend ) ;
93
+ resolve ( false ) ;
94
94
}
95
95
} ) ;
96
96
}
@@ -126,8 +126,11 @@ function initializeFlow(projectPath, flowconfig, otherFlowTypedDefs) {
126
126
) ) :
127
127
true
128
128
) ,
129
- writeFileIfDoesNotExist ( flowconfigPath , flowconfig . join ( '\n' ) ) ,
130
- writeInFileIfNotPresent ( gitignorePath , 'flow-typed' , 'flow-typed' ) ,
129
+ writeFileIfDoesNotExist ( flowconfigPath , flowconfig . join ( '\n' ) )
130
+ . then ( wroteFlowconfig => wroteFlowconfig ?
131
+ writeInFileIfNotPresent ( gitignorePath , 'flow-typed' , 'flow-typed/npm' ) :
132
+ false
133
+ ) ,
131
134
execOneTime (
132
135
flowTypedPath ,
133
136
[ 'install' , '--overwrite' , '--flowVersion=' + localVersion ] ,
0 commit comments