@@ -231,26 +231,39 @@ private void PackageBasicFiles(PackageCreationData preparedData, AppPackage.AppP
231
231
/* Package Content */
232
232
string packageContentPath = FileSystem . Instance . Path . Combine ( preparedData . Project . ProjectDirectory , "PackageContent" ) ;
233
233
234
+ if ( ! FileSystem . Instance . Directory . Exists ( packageContentPath ) )
235
+ {
236
+ // No package content directory found. Skip the rest.
237
+ return ;
238
+ }
239
+
234
240
// Include CompanionFiles
235
241
string companionFilesDirectory =
236
242
FileSystem . Instance . Path . Combine ( packageContentPath , "CompanionFiles" ) ;
237
243
appPackageBuilder . WithCompanionFiles ( companionFilesDirectory ) ;
238
244
239
245
// Include LowCodeApps
240
- IncludeFromPackageContent ( appPackageBuilder , packageContentPath , "LowCodeApps" , ZipType . LowCodeApp ) ;
246
+ IncludeFromPackageContent ( "LowCodeApps" , ZipType . LowCodeApp ) ;
241
247
242
248
// Include Dashboards
243
- IncludeFromPackageContent ( appPackageBuilder , packageContentPath , "Dashboards" , ZipType . Dashboard ) ;
244
- }
245
-
246
- private void IncludeFromPackageContent ( AppPackage . AppPackageBuilder appPackageBuilder , string packageContentPath , string contentFolderName , ZipType contentType )
247
- {
248
- string directory =
249
- FileSystem . Instance . Path . Combine ( packageContentPath , contentFolderName ) ;
249
+ IncludeFromPackageContent ( "Dashboards" , ZipType . Dashboard ) ;
250
+ return ;
250
251
251
- foreach ( string zipFile in FileSystem . Instance . Directory . GetFiles ( directory , "*.zip" ) )
252
+ void IncludeFromPackageContent ( string contentFolderName , ZipType contentType )
252
253
{
253
- appPackageBuilder . WithZip ( zipFile , contentType ) ;
254
+ string directory =
255
+ FileSystem . Instance . Path . Combine ( packageContentPath , contentFolderName ) ;
256
+
257
+ if ( ! FileSystem . Instance . Directory . Exists ( directory ) )
258
+ {
259
+ // Directory doesn't exist, so skip it.
260
+ return ;
261
+ }
262
+
263
+ foreach ( string zipFile in FileSystem . Instance . Directory . GetFiles ( directory , "*.zip" ) )
264
+ {
265
+ appPackageBuilder . WithZip ( zipFile , contentType ) ;
266
+ }
254
267
}
255
268
}
256
269
0 commit comments