cordova-cli icon indicating copy to clipboard operation
cordova-cli copied to clipboard

Run command rewrites config.xml

Open HarelM opened this issue 7 years ago • 4 comments

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.

HarelM avatar Sep 17 '18 20:09 HarelM

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.

raphinesse avatar Apr 11 '19 20:04 raphinesse

I'll upgrade to 9.0 and report back here.

HarelM avatar Apr 14 '19 07:04 HarelM

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'?>

HarelM avatar May 07 '19 17:05 HarelM

*** 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.

longting avatar Jun 26 '19 08:06 longting