lib/scripto/file_commands.rb
def cp_if_necessary(src, dst, mkdir: false, owner: nil, mode: nil)
      return if File.exist?(dst) && FileUtils.compare_file(src, dst)
      cp(src, dst, mkdir: mkdir, owner: owner, mode: mode)
      true
    end
def cp_if_necessary(src, dst, mkdir: false, owner: nil, mode: nil)
      return if File.exist?(dst) && FileUtils.compare_file(src, dst)
      cp(src, dst, mkdir: mkdir, owner: owner, mode: mode)
      true
    end
Runs #cp, but ONLY if +dst+ doesn't exist or differs from +src+. Returns
 true if the file had to be copied. This is useful with verbose?, to get
 an exact changelog.