Skip to content

Commit

Permalink
fix(ios): explicitly return null if source exists and hasnt changed
Browse files Browse the repository at this point in the history
copyDirSync expects a return value of null, otherwise it will copy the file over. As certain files
require the contents to have been ran through _scrubiOSSourceFile, copying over the un-scrubbed file
will cause the code to become invalid and have an impact on other files causing a potential compile
time error

Fixes TIMOB-28152
  • Loading branch information
ewanharris authored and sgtcoolguy committed Sep 29, 2020
1 parent 6d22e29 commit 9b516e4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4685,6 +4685,11 @@ iOSBuilder.prototype.copyTitaniumiOSFiles = function copyTitaniumiOSFiles() {
fs.writeFileSync(destFile, contents);

return null; // tell copyDirSync not to copy the file because we wrote it ourselves
} else if (destExists && !changed) {
// if the destination exists and the file contents haven't changed, return null
// so that copyDirSync doesn't copy over a file where the contents need to be ran
// through _scrubiOSSourceFile
return null;
}
}.bind(this),
afterCopy: function (srcFile, destFile, srcStat, result) {
Expand Down

0 comments on commit 9b516e4

Please sign in to comment.