[
https://issues.apache.org/jira/browse/CB-8052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14603273#comment-14603273
]
ASF GitHub Bot commented on CB-8052:
------------------------------------
Github user purplecabbage commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/239#discussion_r33377496
--- 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 --
The only difference in that copyNewFile throws an error if the target
exists.
common.copyNewFile checks if the file exists, then actually calls
common.copyFile
> Update cordova-lib for webOS support
> ------------------------------------
>
> Key: CB-8052
> URL: https://issues.apache.org/jira/browse/CB-8052
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaLib
> Reporter: Jason Robitaille
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]