cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omefire <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: CB-8052: [webOS] Update cordova-lib for ...
Date Wed, 10 Jun 2015 05:47:29 GMT
Github user omefire commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/239#discussion_r32089841
  
    --- 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 --
    
    Every other platform uses 'copyNewFile' to install 'source-file'. Maybe we should do the
same here ?


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