@@ -689,7 +689,14 @@ export default TurboModuleRegistry.getEnforcing<Spec>('${moduleName}');
689689 this . verboseMessage ( 'Running init-windows with cpp-lib template...' ) ;
690690
691691 try {
692- await initWindowsInternal ( [ ] , config , {
692+ // Create a modified config with the correct root directory
693+ // The original config might point to an example directory instead of the package root
694+ const modifiedConfig : Config = {
695+ ...config ,
696+ root : this . root , // Use our validated package root instead of config.root
697+ } ;
698+
699+ await initWindowsInternal ( [ ] , modifiedConfig , {
693700 template : 'cpp-lib' ,
694701 overwrite : true ,
695702 logging : this . options . logging ,
@@ -716,7 +723,14 @@ export default TurboModuleRegistry.getEnforcing<Spec>('${moduleName}');
716723 this . verboseMessage ( 'Running codegen-windows...' ) ;
717724
718725 try {
719- await codegenWindowsInternal ( [ ] , config , {
726+ // Create a modified config with the correct root directory
727+ // The original config might point to an example directory instead of the package root
728+ const modifiedConfig : Config = {
729+ ...config ,
730+ root : this . root , // Use our validated package root instead of config.root
731+ } ;
732+
733+ await codegenWindowsInternal ( [ ] , modifiedConfig , {
720734 logging : this . options . logging ,
721735 telemetry : this . options . telemetry ,
722736 } ) ;
0 commit comments