lib/omnibus/compressors/dmg.rb
def set_dmg_icon
      log.info(log_key) { "Setting dmg icon" }

      Dir.chdir(staging_dir) do
        shellout! <<-EOH.gsub(/^ {10}/, "")
          # Convert the png to an icon
          sips -i "#{resource_path('icon.png')}"

          # Extract the icon into its own resource
          DeRez -only icns "#{resource_path('icon.png')}" > tmp.rsrc

          # Append the icon reosurce to the DMG
          Rez -append tmp.rsrc -o "#{package_path}"

          # Source the icon
          SetFile -a C "#{package_path}"
        EOH
      end
    end
def set_dmg_icon
      log.info(log_key) { "Setting dmg icon" }

      Dir.chdir(staging_dir) do
        shellout! <<-EOH.gsub(/^ {10}/, "")
          # Convert the png to an icon
          sips -i "#{resource_path('icon.png')}"

          # Extract the icon into its own resource
          DeRez -only icns "#{resource_path('icon.png')}" > tmp.rsrc

          # Append the icon reosurce to the DMG
          Rez -append tmp.rsrc -o "#{package_path}"

          # Source the icon
          SetFile -a C "#{package_path}"
        EOH
      end
    end
Set the dmg icon to our custom icon.

 @return [void]