function convertToIcns(pngSrc, icnsDest, callback) {
  if (!isOSX()) {
    callback('OSX is required to convert .png to .icns icon', pngSrc);
    return;
  }

  shell.exec(
    `"${PNG_TO_ICNS_BIN_PATH}" "${pngSrc}" "${icnsDest}"`,
    { silent: true },
    (exitCode, stdOut, stdError) => {
      if (stdOut.includes('icon.iconset:error') || exitCode) {
        if (exitCode) {
          callback(
            {
              stdOut,
              stdError,
            },
            pngSrc,
          );
          return;
        }

        callback(stdOut, pngSrc);
        return;
      }

      callback(null, icnsDest);
    },
  );
}
function convertToIcns(pngSrc, icnsDest, callback) {
  if (!isOSX()) {
    callback('OSX is required to convert .png to .icns icon', pngSrc);
    return;
  }

  shell.exec(
    `"${PNG_TO_ICNS_BIN_PATH}" "${pngSrc}" "${icnsDest}"`,
    { silent: true },
    (exitCode, stdOut, stdError) => {
      if (stdOut.includes('icon.iconset:error') || exitCode) {
        if (exitCode) {
          callback(
            {
              stdOut,
              stdError,
            },
            pngSrc,
          );
          return;
        }

        callback(stdOut, pngSrc);
        return;
      }

      callback(null, icnsDest);
    },
  );
}
function convertToIcns ( pngSrc , icnsDest , callback ) { if ( ! isOSX ( ) ) { callback ( 'OSX is required to convert .png to .icns icon' , pngSrc ) ; return ; } shell . exec ( ` ${ PNG_TO_ICNS_BIN_PATH } ${ pngSrc } ${ icnsDest } ` , { silent : true } , ( exitCode , stdOut , stdError ) => { if ( stdOut . includes ( 'icon.iconset:error' ) || exitCode ) { if ( exitCode ) { callback ( { stdOut , stdError , } , pngSrc , ) ; return ; } callback ( stdOut , pngSrc ) ; return ; } callback ( null , icnsDest ) ; } , ) ; }
@callback pngToIcnsCallback
@param error
@param {string} icnsDest If error, will return the original png src
 

@param {string} pngSrc
@param {string} icnsDest
@param {pngToIcnsCallback} callback
@callback pngToIcnsCallback @param error @param { string } icnsDest If error will return the original png src
Convert. png to. icns