File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,23 @@ export class PlatformController implements IPlatformController {
143
143
const hasPlatformDirectory = this . $fs . exists (
144
144
path . join ( projectData . platformsDir , platformName )
145
145
) ;
146
+
147
+ if ( hasPlatformDirectory ) {
148
+ const platformDirectoryItemCount = this . $fs . readDirectory (
149
+ path . join ( projectData . platformsDir , platformName )
150
+ ) . length ;
151
+
152
+ // 5 is a magic number to approximate a valid platform folder
153
+ // any valid platform should contain at least 5 files
154
+ // we choose 5 to avoid false-positives due to system files like .DS_Store etc.
155
+ if ( platformDirectoryItemCount <= 5 ) {
156
+ this . $logger . warn (
157
+ `The platforms/${ platformName } folder appears to be invalid. If the build fails, run 'ns clean' and rebuild the app.` ,
158
+ { wrapMessageWithBorders : true }
159
+ ) ;
160
+ }
161
+ }
162
+
146
163
const shouldAddNativePlatform =
147
164
! nativePrepare || ! nativePrepare . skipNativePrepare ;
148
165
const prepareInfo = this . $projectChangesService . getPrepareInfo (
You can’t perform that action at this time.
0 commit comments