File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,11 +17,20 @@ const withIOSSounds = (config) => {
1717 return withXcodeProject ( config , async ( cfg ) => {
1818 const xcodeProject = cfg . modResults ;
1919 const appName = 'CodeBuilder Admin' ; // Match your iOS project name
20- const soundFiles = fs . readdirSync ( `./ios/${ appName } /Sounds` ) ;
20+ const iosFolderName = appName . replace ( / \s + / g, '' ) ;
21+ const soundsDir = `./ios/${ iosFolderName } /Sounds` ;
22+
23+ // Check if directory exists before reading (handles prebuild --clean)
24+ if ( ! fs . existsSync ( soundsDir ) ) {
25+ console . log ( `⚠️ Sounds directory not found at ${ soundsDir } , skipping sound file registration` ) ;
26+ return cfg ;
27+ }
28+
29+ const soundFiles = fs . readdirSync ( soundsDir ) ;
2130
2231 soundFiles . forEach ( ( file ) => {
2332 xcodeProject . addResourceFile ( {
24- path : `${ appName } /Sounds/${ file } ` ,
33+ path : `${ iosFolderName } /Sounds/${ file } ` ,
2534 group : 'Resources' ,
2635 } ) ;
2736 } ) ;
You can’t perform that action at this time.
0 commit comments