Fixes an issue where copying the generated framework after a build would fail if the framework already exists in the GeneratedFrameworks folder, even if that existing framework is out-of-date.
This issue is caused by FileUtils.mv exibiting different behavior for files than for directories. If the destination already exists and is a file then :force => true causes FileUtils.mv to remove the destination and proceed with the move as expected. However, if the destination already exists and is a directory, then FileUtils.mv raises an error and by specifying the :force => true flag, that error is swallowed. This effectively results in a silent failure of the FileUtils.mv command if the destination already exists and is a directory (yet works as expected if it's a file).
Fixes an issue where copying the generated framework after a build would fail if the framework already exists in the GeneratedFrameworks folder, even if that existing framework is out-of-date.
This issue is caused by
FileUtils.mv
exibiting different behavior for files than for directories. If the destination already exists and is a file then:force => true
causesFileUtils.mv
to remove the destination and proceed with the move as expected. However, if the destination already exists and is a directory, thenFileUtils.mv
raises an error and by specifying the:force => true
flag, that error is swallowed. This effectively results in a silent failure of theFileUtils.mv
command if the destination already exists and is a directory (yet works as expected if it's a file).Note: This PR is built on top of https://github.com/leavez/cocoapods-binary/pull/103. I'll rebase this PR when that gets merged (or another fix for travis builds is committed).