forked from apache/cordova-plugin-file-transfer
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
11 changed files
with
1,239 additions
and
1,634 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,6 @@ | |
} | ||
}, | ||
"devDependencies": { | ||
"@cordova/eslint-config": "^3.0.0" | ||
"@cordova/eslint-config": "^4.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,13 @@ | |
* | ||
*/ | ||
|
||
var path = require('path'); | ||
var fs = require('fs'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
module.exports = function (context) { | ||
function main () { | ||
// get the file transfer server address from the specified variables | ||
var fileTransferServerAddress = getFileTransferServerAddress(context) || getDefaultFileTransferServerAddress(context); | ||
const 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".' | ||
|
@@ -38,10 +38,10 @@ module.exports = function (context) { | |
} | ||
|
||
function getDefaultFileTransferServerAddress (context) { | ||
var address = null; | ||
var configNodes = context.opts.plugin.pluginInfo._et._root._children; | ||
let address = null; | ||
const configNodes = context.opts.plugin.pluginInfo._et._root._children; | ||
|
||
for (var node in configNodes) { | ||
for (const node in configNodes) { | ||
if (configNodes[node].attrib.name === 'FILETRANSFER_SERVER_ADDRESS') { | ||
address = configNodes[node].attrib.default; | ||
} | ||
|
@@ -51,13 +51,13 @@ module.exports = function (context) { | |
} | ||
|
||
function getFileTransferServerAddress (context) { | ||
var platformJsonFile = path.join( | ||
const platformJsonFile = path.join( | ||
context.opts.projectRoot, | ||
'platforms', | ||
context.opts.platforms[0], | ||
context.opts.platforms[0] + '.json' | ||
); | ||
var platformJson = JSON.parse(fs.readFileSync(platformJsonFile, 'utf8')); | ||
const platformJson = JSON.parse(fs.readFileSync(platformJsonFile, 'utf8')); | ||
|
||
if ( | ||
platformJson && | ||
|
@@ -72,12 +72,12 @@ module.exports = function (context) { | |
} | ||
|
||
function writeFileTransferOptions (address, context) { | ||
for (var p in context.opts.paths) { | ||
var ftOpts = { | ||
for (const p in context.opts.paths) { | ||
const ftOpts = { | ||
serverAddress: address | ||
}; | ||
var ftOptsString = JSON.stringify(ftOpts); | ||
var ftOptsFile = path.join(context.opts.paths[p], 'fileTransferOpts.json'); | ||
const ftOptsString = JSON.stringify(ftOpts); | ||
const ftOptsFile = path.join(context.opts.paths[p], 'fileTransferOpts.json'); | ||
fs.writeFileSync(ftOptsFile, ftOptsString, 'utf8'); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.