ME created CB-7525:
----------------------

             Summary: cordova serve command can DELETE (re-init) YOUR PROJECT
                 Key: CB-7525
                 URL: https://issues.apache.org/jira/browse/CB-7525
             Project: Apache Cordova
          Issue Type: Bug
          Components: CLI
    Affects Versions: 3.4.0
         Environment: OSX 10.9.2.  Actual CLI version is  3.4.1-0.1.0 "Affects 
Version/s" field would not allow.
            Reporter: ME


Decided to see if the phoneagap developer app from iTunes would work with 
cordova yet so I installed it on iOS and...

Set path on OSX CLI to iOS platform www dir and issued "cordova serve" results 
in the replacement of the www dir with a default version (i.e. same as after 
cordova create , add platform) DELETING ALL FILES except the plugins WITH NO 
NOTICE (SERIOUSLY?!?!?! ). This behavior is repeatable.  

The following output is from cordova serve
Static file server running on port 8000 (i.e. http://localhost:8000)
CTRL + C to shut down
404 /__api__/register
302 /ios/
200 /ios/www/
200 /ios/www/css/index.css
200 /ios/www/cordova.js
200 /ios/www/js/index.js
200 /ios/www/img/logo.png
200 /ios/www/cordova_plugins.js
200 /ios/www/plugins/org.apache.cordova.splashscreen/www/splashscreen.js
200 /ios/www/plugins/cc.fovea.plugins.inapppurchase/InAppPurchase.js
200 /ios/www/plugins/org.apache.cordova.console/www/console-via-logger.js
200 /ios/www/plugins/org.apache.cordova.dialogs/www/notification.js
200 /ios/www/plugins/org.apache.cordova.device/www/device.js
200 /ios/www/plugins/org.apache.cordova.vibration/www/vibration.js
200 /ios/www/plugins/org.apache.cordova.network-information/www/network.js
200 /ios/www/plugins/org.apache.cordova.network-information/www/Connection.js
200 /ios/www/plugins/org.apache.cordova.console/www/logger.js
200 /ios/www/plugins/org.apache.cordova.inappbrowser/www/inappbrowser.js 

Following this output with ^C and then ls at the resulting command prompt 
results in no files showing, only after changing path from the www dir are the 
default implementation files visible. 

Attempting to issue any cordova command results in the following (also a bug, 
CLI should be able to gracefully survive a bad path):
cordova help

node.js:811
    var cwd = process.cwd();
                      ^
Error: ENOENT, no such file or directory
    at Function.startup.resolveArgv0 (node.js:811:23)
    at startup (node.js:58:13)
    at node.js:902:3

--------------------------------

The following is output from cordova info (note that customizations to 
config.xml were overwritten with default info)

Useful Information For Submitting Bug Reports and Getting Help

Current Node Version

    v0.10.26

Current Cordova CLI Version

    3.4.1-0.1.0

Current Config.xml

    <?xml version='1.0' encoding='utf-8'?>
<widget id="com.redacted.redacted" version="0.0.1" 
xmlns="http://www.w3.org/ns/widgets"; 
xmlns:cdv="http://cordova.apache.org/ns/1.0";>
    <name>Redacted</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>
    <content src="index.html" />
    <access origin="*" />
    <preference name="fullscreen" value="true" />
    <preference name="DisallowOverscroll" value="true"/>
</widget>


Currently Installed Platforms    

    android

    Available Android targets:
----------
id: 1 or "android-16"
     Name: Android 4.1.2
     Type: Platform
     API level: 16
     Revision: 4
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, 
WXGA720, WXGA800, WXGA800-7in
     ABIs : armeabi-v7a, x86
----------
id: 2 or "Google Inc.:Google APIs:16"
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 3
     Description: Android + Google APIs
     Based on Android 4.1.2 (API level 16)
     Libraries:
      * com.google.android.media.effects (effects.jar)
          Collection of video effects
      * com.android.future.usb.accessory (usb.jar)
          API for USB Accessories
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, 
WVGA800 (default), QVGA, WXGA800
     ABIs : armeabi-v7a
----------
id: 3 or "android-17"
     Name: Android 4.2.2
     Type: Platform
     API level: 17
     Revision: 2
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, 
WXGA720, WXGA800, WXGA800-7in
     ABIs : no ABIs.
----------
id: 4 or "android-19"
     Name: Android 4.4
     Type: Platform
     API level: 19
     Revision: 1
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, 
WXGA720, WXGA800, WXGA800-7in
     ABIs : armeabi-v7a

    ios

    Xcode 5.1.1
Build version 5B1008

Currently Installed Plugins
    
cc.fovea.plugins.inapppurchase,org.apache.cordova.console,org.apache.cordova.device,org.apache.cordova.dialogs,org.apache.cordova.inappbrowser,org.apache.cordova.network-information,org.apache.cordova.splashscreen,org.apache.cordova.vibration



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to