File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 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 {
143143 const hasPlatformDirectory = this . $fs . exists (
144144 path . join ( projectData . platformsDir , platformName )
145145 ) ;
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+
146163 const shouldAddNativePlatform =
147164 ! nativePrepare || ! nativePrepare . skipNativePrepare ;
148165 const prepareInfo = this . $projectChangesService . getPrepareInfo (
You can’t perform that action at this time.
0 commit comments