Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 003ED100B5 for ; Thu, 17 Apr 2014 21:46:45 +0000 (UTC) Received: (qmail 62851 invoked by uid 500); 17 Apr 2014 21:46:44 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 62786 invoked by uid 500); 17 Apr 2014 21:46:44 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 62775 invoked by uid 99); 17 Apr 2014 21:46:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Apr 2014 21:46:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E0C2B9923CF; Thu, 17 Apr 2014 21:46:43 +0000 (UTC) From: kamrik To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-cli pull request: CB-6469 - Restore plugins from config.xm... Content-Type: text/plain Message-Id: <20140417214643.E0C2B9923CF@tyr.zones.apache.org> Date: Thu, 17 Apr 2014 21:46:43 +0000 (UTC) Github user kamrik commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/165#discussion_r11755812 --- Diff: src/save.js --- @@ -0,0 +1,71 @@ +/** + 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. +*/ + +var cordova_util = require('./util'), + ConfigParser = require('./ConfigParser'), + path = require('path'), + xml =require('./xml-helpers') + Q = require('q'), + events = require('./events'); + +; + + +module.exports = function save(target){ + var projectHome = cordova_util.cdProjectRoot(); + var configPath = cordova_util.projectConfig(projectHome); + var configXml = new ConfigParser(configPath); + var pluginsPath = path.join(projectHome, 'plugins'); + var plugins = cordova_util.findPlugins(pluginsPath); + + return Q.all(plugins.map(function(plugin){ + var currentPluginPath = path.join(pluginsPath,plugin); + var name = readPluginName(currentPluginPath); + var id = plugin; + var version = readPluginVersion(currentPluginPath); + var features = configXml.doc.findall('feature'); + for(var i=0; i