Run command rewrites config.xml
While other command are expected to alter config.xml, run is not a command I would expect to change it.
When I edit config.xml to make the xml consistent or pretty I don't expect run to rewrite it.
I could not reproduce that behavior with Cordova 9 using the following commands:
cordova create test-app && cd test-app
cordova platform add browser
# edit config.xml here
cordova platform run browser
My changes to the default config.xml:
<?xml version='1.0' encoding='utf-8'?>
-<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="io.cordova.hellocordova"
+ version="1.0.0"
+ xmlns="http://www.w3.org/ns/widgets"
+ xmlns:cdv="http://cordova.apache.org/ns/1.0">
+
<name>HelloCordova</name>
+
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
+
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
Please provide detailed instructions on how to reproduce the behavior you observed.
I'll upgrade to 9.0 and report back here.
Sorry, I can't test 9.0 as I can't use it with windows 10 apparently due to this issue I think:
https://github.com/apache/cordova-common/issues/64
In any case my test case for 8.1.2 was to change the quotes from ' to " and run. i.e.:
<?xml version="1.0" encoding="utf-8"?>
would turn into:
<?xml version='1.0' encoding='utf-8'?>
*** The same problem.***
Env
cordova 8.1.2
sytstem: win7 and Mac OS10.2+
step
1 add comment in config.xml,like this
<!-- my comment ... -->
2 execute cordova build android or cordova run ios
3 check config.xml, the original added comment is gone! the modification time of this file has been changed to the present.