Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BD798200B8B for ; Tue, 4 Oct 2016 09:03:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BC2DE160AC9; Tue, 4 Oct 2016 07:03:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0E1BC160AC5 for ; Tue, 4 Oct 2016 09:03:58 +0200 (CEST) Received: (qmail 63529 invoked by uid 500); 4 Oct 2016 07:03:57 -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 62924 invoked by uid 99); 4 Oct 2016 07:03:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2016 07:03:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4787AE00C7; Tue, 4 Oct 2016 07:03:57 +0000 (UTC) From: vladimir-kotikov To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-paramedic pull request #17: CB-11926 Pass the file transfer server a... Content-Type: text/plain Message-Id: <20161004070357.4787AE00C7@git1-us-west.apache.org> Date: Tue, 4 Oct 2016 07:03:57 +0000 (UTC) archived-at: Tue, 04 Oct 2016 07:03:59 -0000 Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/17#discussion_r81695543 --- Diff: lib/PluginsManager.js --- @@ -41,16 +43,31 @@ PluginsManager.prototype.installTestsForExistingPlugins = function () { installedPlugins.forEach(function(plugin) { // there is test plugin available if (fs.existsSync(path.join(plugin.dir, 'tests', 'plugin.xml'))) { - me.installSinglePlugin(path.join(plugin.dir, 'tests')); + var additionalArgs = ''; + if (plugin.id.indexOf('cordova-plugin-file-transfer') >= 0) { + var fileServerUrl = Server.prototype.getConnectionAddress.bind({ + externalServerUrl: me.config.getExternalServerUrl() + }, me.config.getPlatformId())() + ':5000'; + additionalArgs += ' --variable FILETRANSFER_SERVER_ADDRESS=' + fileServerUrl; + } + me.installSinglePlugin(path.join(plugin.dir, 'tests') + additionalArgs); } }); // this will list installed plugins and their versions this.showPluginsVersions(); }; PluginsManager.prototype.installSinglePlugin = function (plugin) { - if (fs.existsSync(path.resolve(this.storedCWD, plugin))) { - plugin = path.resolve(this.storedCWD, plugin); + var pluginPath = plugin; + var args = ''; + // separate plugin name from args + var argsIndex = plugin.indexOf(' --'); --- End diff -- So you're building a string in `installTestsForExistingPlugins` and then splitting it back to `(plugin, arguments)` tuple? I don't think this is an efficient way to pass additional arguments to the function. Can we just add an optional argument to be able to specify any flags to `cordova plugin add`? --- 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