diff --git a/packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js b/packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js index 9f334320a0a450..de2fd09e833515 100644 --- a/packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js +++ b/packages/react-native/scripts/codegen/__tests__/generate-artifacts-executor-test.js @@ -62,7 +62,7 @@ describe('generateCode', () => { expect(child_process.execSync).toHaveBeenCalledTimes(1); expect(child_process.execSync).toHaveBeenNthCalledWith( 1, - `cp -R ${tmpOutputDir}/* ${iosOutputDir}`, + `cp -R ${tmpOutputDir}/* "${iosOutputDir}"`, ); expect(fs.mkdirSync).toHaveBeenCalledTimes(2); diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor.js b/packages/react-native/scripts/codegen/generate-artifacts-executor.js index 53998580d2c1e1..025f80c78663c3 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor.js @@ -372,7 +372,7 @@ function generateCode(iosOutputDir, library, tmpDir, node, pathToSchema) { const outputDir = CORE_LIBRARIES_WITH_OUTPUT_FOLDER[library.config.name] ?? iosOutputDir; fs.mkdirSync(outputDir, {recursive: true}); - execSync(`cp -R ${tmpOutputDir}/* ${outputDir}`); + execSync(`cp -R ${tmpOutputDir}/* "${outputDir}"`); console.log(`[Codegen] Generated artifacts: ${iosOutputDir}`); }