Uday Kiran created CB-14153:
-------------------------------

             Summary: overwrite mode for edit-config in plist-helper.js
                 Key: CB-14153
                 URL: https://issues.apache.org/jira/browse/CB-14153
             Project: Apache Cordova
          Issue Type: Improvement
          Components: cordova-cli, cordova-common
    Affects Versions: [email protected]
            Reporter: Uday Kiran


overwrite mode for *-Info.plist, as part of edit-config configuration, is not 
implemented in plist-helper.js file. 

I want to override certain elments in the plist file. I added edit-config for 
the element. Instead of overriding it is merging the children.

I am using [email protected]

I have given a temporary fix in my local system.

 
function graftPLIST (doc, xml, selector, mode) {
varobj=plist.parse('<plist>'+xml+'</plist>');
{code:java}
varnode=doc[selector];
if (node&&Array.isArray(node) &&Array.isArray(obj)) {
//temporary fix
      (mode == 'overwrite') ? (node = obj) : (node = node.concat(obj));
for (vari=0; i<node.length; i++) {
for (varj=i+1; j<node.length; ++j) {
if (nodeEqual(node[i], node[j])) { node.splice(j--, 1); }
}
}
doc[selector] =node;
} else {
// plist uses objects for <dict>. If we have two dicts we merge them instead of
// overriding the old one. See CB-6472
if (node&&__.isObject(node) &&__.isObject(obj) &&!__.isDate(node) 
&&!__.isDate(obj)) { // arrays checked above
__.extend(obj, node);
}
doc[selector] =obj;
}

returntrue;
}
Thanks{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to