cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabbage <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: CB-8052: [webOS] Update cordova-lib for ...
Date Fri, 26 Jun 2015 18:03:31 GMT
Github user purplecabbage commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/239#discussion_r33379893
  
    --- Diff: cordova-lib/src/plugman/platforms/webos.js ---
    @@ -0,0 +1,99 @@
    +/**
    +    Licensed to the Apache Software Foundation (ASF) under one
    +    or more contributor license agreements.  See the NOTICE file
    +    distributed with this work for additional information
    +    regarding copyright ownership.  The ASF licenses this file
    +    to you under the Apache License, Version 2.0 (the
    +    "License"); you may not use this file except in compliance
    +    with the License.  You may obtain a copy of the License at
    +
    +    http://www.apache.org/licenses/LICENSE-2.0
    +
    +    Unless required by applicable law or agreed to in writing,
    +    software distributed under the License is distributed on an
    +    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +    KIND, either express or implied.  See the License for the
    +    specific language governing permissions and limitations
    +    under the License.
    +*/
    +
    +/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
    +          indent:4, unused:vars, latedef:nofunc,
    +          laxcomma:true, sub:true
    +*/
    +
    +var path = require('path')
    +    , fs = require('fs')
    +    , common = require('./common')
    +    , events = require('../../events')
    +    , xml_helpers = require(path.join(__dirname, '..', '..', 'util', 'xml-helpers'))
    +    ;
    +
    +module.exports = {
    +    www_dir: function(project_dir) {
    +        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'];
    +    },
    +    'source-file':{
    +        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
    +            var dest = path.join(obj.targetDir, path.basename(obj.src));
    +            common.copyFile(plugin_dir, obj.src, project_dir, dest);
    --- End diff --
    
    It was added here: 
    https://github.com/apache/cordova-lib/commit/ae2ce7ac6325d1c6558365b4be82e5a8ff0983b9#diff-bf0ba2178fefa5505235315252ccc98c
    
    Not sure why it is required, other than the somewhat meaningless 'refactor'  commit message.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message