Example #1
0
/**
 * Gets all scripts defined in config.xml with the specified type and platforms.
 */
function getScriptsFromConfigXml(hook, opts) {
    var configPath = cordovaUtil.projectConfig(opts.projectRoot);
    var configXml = new ConfigParser(configPath);

    return configXml.getHookScripts(hook, opts.cordova.platforms).map(function(scriptElement) {
        return {
            path: scriptElement.attrib.src,
            fullPath: path.join(opts.projectRoot, scriptElement.attrib.src)
        };
    });
}