Open FranciscoG opened 7 years ago
That is nice. With windows you need to call cordova-icon.cmd
so I made some changes to your code:
#!/usr/bin/env node
const spawnSync = require('child_process').spawnSync;
var options = {
cwd: process.cwd(),
encoding : 'utf8'
};
const os = require('os');
var cmdSuffix = (os.platform() === 'win32' ? '.cmd' : '');
var icon = spawnSync('cordova-icon' + cmdSuffix, ['--icon=res/icon.png'], options);
if (icon.stderr) {
console.log(icon.stderr.toString());
}
console.log(icon.stdout.toString());
Cordova Hooks documentation shows using the
/hooks
directory is deprecated. Suggest updating your documentation to use newer hook scripts format.This worked for me. It's probably not perfect but for now it works
I created a
hook_scripts
folder. Then in myconfig.xml
I have this: