[ 
https://issues.apache.org/jira/browse/CB-10662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167097#comment-15167097
 ] 

ASF GitHub Bot commented on CB-10662:
-------------------------------------

Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/398#discussion_r54081599
  
    --- Diff: cordova-lib/src/plugman/platforms/browser.js ---
    @@ -31,25 +29,7 @@ module.exports = {
             return path.join(project_dir, 'www');
         },
         package_name:function(project_dir) {
    -        // preferred location if cordova >= 3.4
    -        var preferred_path = path.join(project_dir, 'config.xml');
    -        var config_path;
    -
    -        if (!fs.existsSync(preferred_path)) {
    -            // older location
    -            var old_config_path = 
path.join(module.exports.www_dir(project_dir), 'config.xml');
    -            if (!fs.existsSync(old_config_path)) {
    -                // output newer location and fail reading
    -                config_path = preferred_path;
    -                events.emit('verbose', 'unable to find '+config_path);
    -            } else {
    -                config_path = old_config_path;
    -            }
    -        } else {
    -            config_path = preferred_path;
    -        }
    -        var widget_doc = xml_helpers.parseElementtreeSync(config_path);
    -        return widget_doc._root.attrib['id'];
    +        return common.package_name(project_dir);
    --- End diff --
    
    Agree about `firefoxos` and `webos` (I'd add here `tizen` as well)
    
    As for `blackberry10` - it does not rely on configs other than the one at 
the platform `www` dir, so using common `package_name` might lead to unexpected 
results. Also seems that it doesn't affected by this bug as it always copying 
own `config.xml` at `create`


> Adding browser platform fails if plugins added since fix for CB-10641
> ---------------------------------------------------------------------
>
>                 Key: CB-10662
>                 URL: https://issues.apache.org/jira/browse/CB-10662
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib
>            Reporter: Tim Barham
>            Assignee: Vladimir Kotikov
>            Priority: Blocker
>              Labels: browser, regression, triaged
>
> Since the fix for [CB-10641|https://issues.apache.org/jira/browse/CB-10641], 
> adding the browser platform throws an exception if a plugin has been added to 
> the project:
> {noformat}
> $ cordova create AddBrowserError
> Creating a new cordova project.
> $ cd AddBrowserError
> $ cordova plugin add cordova-plugin-device
> Fetching plugin "cordova-plugin-device@~1.1.1" via npm
> $ cordova platform add browser
> Adding browser project...
> Running command: cmd "/s /c "cordova-browser\4.0.0\package\bin\create.bat 
> AddBrowserError\platforms\browser io.cordova.hellocordova HelloCordova""
> Creating Browser project. Path: platforms\browser
> Installing "cordova-plugin-device" for browser
> Failed to install 'cordova-plugin-device':Error: ENOENT: no such file or 
> directory, open 'AddBrowserError\platforms\browser\config.xml'
>     at Error (native)
>     at Object.fs.openSync (fs.js:549:18)
>     at Object.fs.readFileSync (fs.js:397:15)
>     at Object.module.exports.parseElementtreeSync 
> (cordova-common\src\util\xml-helpers.js:118:27)
>     at Object.module.exports.package_name 
> (cordova-lib\src\plugman\platforms\browser.js:51:38)
>     at cordova-lib\src\platforms\PlatformApiPoly.js:264:67
>     at _fulfilled (cordova-common\node_modules\q\q.js:834:54)
>     at self.promiseDispatch.done (cordova-common\node_modules\q\q.js:863:30)
>     at Promise.promise.promiseDispatch 
> (cordova-common\node_modules\q\q.js:796:13)
>     at cordova-common\node_modules\q\q.js:857:14
> {noformat}



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

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

Reply via email to