diff --git a/bin/templates/cordova/lib/pluginHandlers.js b/bin/templates/cordova/lib/pluginHandlers.js index 1ee6b1f3..83ccf372 100644 --- a/bin/templates/cordova/lib/pluginHandlers.js +++ b/bin/templates/cordova/lib/pluginHandlers.js @@ -31,7 +31,11 @@ var handlers = { if (!obj.src) throw new CordovaError(' element is missing "src" attribute for plugin: ' + plugin.id); if (!obj.targetDir) throw new CordovaError(' element is missing "target-dir" attribute for plugin: ' + plugin.id); var dest = path.join(obj.targetDir, path.basename(obj.src)); - copyNewFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); + if (options && options.force) { + copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); + } else { + copyNewFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link)); + } }, uninstall:function(obj, plugin, project, options) { var dest = path.join(obj.targetDir, path.basename(obj.src));