Skip to content

Commit

Permalink
Use fs.cpSync instead of execSync('cp ... (facebook#43368)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#43368

This diff replaces direct invocation of the `cp` command with the platform agnostic `fs.cpSync`.
Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D54634108

fbshipit-source-id: 41fe7b44b6534026ef1b930da85725bf3eb1e7bb
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Mar 7, 2024
1 parent f7bbaff commit ff03b14
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,7 @@ function generateCode(outputPath, schemaInfo, includesGeneratedCode, platform) {
const outputDir =
reactNativeCoreLibraryOutputPath(libraryName, platform) ?? outputPath;
fs.mkdirSync(outputDir, {recursive: true});
// TODO: Fix this. This will not work on Windows.
execSync(`cp -R ${tmpOutputDir}/* "${outputDir}"`);
fs.cpSync(tmpOutputDir, outputDir, {recursive: true});
console.log(`[Codegen] Generated artifacts: ${outputDir}`);
}

Expand Down

0 comments on commit ff03b14

Please sign in to comment.