You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/03/25 18:21:13 UTC

[2/4] git commit: plugin add/rm no longer change top-level www

plugin add/rm no longer change top-level www


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/b5d9f222
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/b5d9f222
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/b5d9f222

Branch: refs/heads/master
Commit: b5d9f222761ccdcda326f66941b9fdd0ea7a3d7c
Parents: 964e324
Author: Braden Shepherdson <br...@gmail.com>
Authored: Wed Feb 27 15:11:24 2013 -0500
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Tue Mar 12 10:39:39 2013 -0400

----------------------------------------------------------------------
 src/plugin.js |   34 ----------------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b5d9f222/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index 04e64f6..d18bf18 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -111,20 +111,6 @@ module.exports = function plugin(command, targets, callback) {
                     if (plugin_cli.code > 0) throw new Error('An error occured during plugin installation for ' + platform + '. ' + plugin_cli.output);
                 });
 
-                // Add the plugin web assets to the www folder as well.
-                var assets = pluginXml.doc.findall('plugin/asset');
-                assets.forEach(function(asset) {
-                    asset = path.resolve(path.join(target, asset.attrib.src));
-                    var info = fs.lstatSync(asset);
-                    var name = asset.substr(asset.lastIndexOf('/')+1);
-                    var wwwPath = path.join(projectWww, name);
-                    if (info.isDirectory()) {
-                        shell.cp('-r', asset, projectWww);
-                    } else {
-                        fs.writeFileSync(wwwPath, fs.readFileSync(asset));
-                    }
-                });
-
                 // Finally copy the plugin into the project
                 var targetPath = path.join(pluginPath, targetName);
                 shell.mkdir('-p', targetPath);
@@ -163,26 +149,6 @@ module.exports = function plugin(command, targets, callback) {
                         if (plugin_cli.code > 0) throw new Error('An error occured during plugin uninstallation for ' + platform + '. ' + plugin_cli.output);
                     });
 
-                    // Remove the plugin web assets from the www folder as well.
-                    var assets = pluginXml.doc.findall('plugin/asset');
-                    assets.forEach(function(asset) {
-                        asset = path.resolve(path.join(projectWww, asset.attrib.src));
-                        var info = fs.lstatSync(asset);
-                        if (info.isDirectory()) {
-                            shell.rm('-rf', asset);
-                        } else {
-                            fs.unlinkSync(asset);
-                        }
-                    });
-
-                    // Remove the plugin web assets to the www folder as well
-                    // TODO: assumption that web assets go under www folder
-                    // inside plugin dir; instead should read plugin.xml
-                    wwwContents.forEach(function(asset) {
-                        asset = path.resolve(path.join(projectWww, asset));
-                        var info = fs.lstatSync(asset);
-                    });
-
                     // Finally remove the plugin dir from plugins/
                     shell.rm('-rf', targetPath);