Jahrenski commented on issue #97:
URL: https://github.com/apache/cordova-electron/issues/97#issuecomment-737265760


   To fix this problem I use this custom hook :
   
   ```
   module.exports = function(context) {
     
     console.log('[HACK] Copy of all electron icons');
   
     //Prevent this running for other platforms.
     if ( context.opts.platforms.indexOf('electron') < 0 ) {
       return;
     }
   
     var fs   = require('fs'),
         path = require('path')
   
     const iconsPath = path.join(context.opts.projectRoot, 
'resources/electron/icon/icon.png');
     const destination = path.join(context.opts.projectRoot, 
'platforms/electron/build-res/icon.png');
   
     fs.createReadStream(iconsPath).pipe(fs.createWriteStream(destination));
   };
   ```
   
   And then call it from your Config.xml file
   
   ```
   <platform name="electron">
           <hook src="hooks/copy-icons.js" type="after_prepare" />
           <icon src="resources/electron/icon/icon.png" />
   </platform>
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to