CB-12100 (ios) Fixed test plugin install at platform add on [email protected]
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/addf885c Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/addf885c Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/addf885c Branch: refs/heads/1.6.x Commit: addf885c7474422d4d5bfed62544f7f0425c23c4 Parents: ac5233d Author: Alexander Sorokin <[email protected]> Authored: Tue Nov 1 19:15:32 2016 +0300 Committer: Alexander Sorokin <[email protected]> Committed: Tue Nov 1 19:15:32 2016 +0300 ---------------------------------------------------------------------- tests/hooks/after_prepare.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/addf885c/tests/hooks/after_prepare.js ---------------------------------------------------------------------- diff --git a/tests/hooks/after_prepare.js b/tests/hooks/after_prepare.js index e6f01e7..6101c62 100644 --- a/tests/hooks/after_prepare.js +++ b/tests/hooks/after_prepare.js @@ -29,6 +29,7 @@ module.exports = function(context) { // get the file transfer server address from the specified variables var fileTransferServerAddress = getFileTransferServerAddress(context) || getDefaultFileTransferServerAddress(context); console.log('Tests will use the following file transfer server address: ' + fileTransferServerAddress); + console.log('If you\'re using [email protected] and the above address is wrong at "platform add", don\'t worry, it\'ll fix itself on "cordova run" or "cordova prepare".'); // pass it to the tests writeFileTransferOptions(fileTransferServerAddress, context); @@ -51,7 +52,11 @@ module.exports = function(context) { var platformJsonFile = path.join(context.opts.projectRoot, 'platforms', context.opts.platforms[0], context.opts.platforms[0] + '.json'); var platformJson = JSON.parse(fs.readFileSync(platformJsonFile, 'utf8')); - return platformJson.installed_plugins['cordova-plugin-file-transfer-tests'].FILETRANSFER_SERVER_ADDRESS; + if (platformJson && platformJson.installed_plugins && platformJson.installed_plugins['cordova-plugin-file-transfer-tests'] && platformJson.installed_plugins['cordova-plugin-file-transfer-tests'].FILETRANSFER_SERVER_ADDRESS) { + return platformJson.installed_plugins['cordova-plugin-file-transfer-tests'].FILETRANSFER_SERVER_ADDRESS; + } else { + return null; + } } function writeFileTransferOptions(address, context) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
