Skip to content

Commit

Permalink
Merge pull request #9577 from ewanharris/TIMOB-25405_2
Browse files Browse the repository at this point in the history
[6_3_X][TIMOB-25405] Remove const/let usage
  • Loading branch information
mukherjee2 committed Nov 1, 2017
2 parents d15b979 + 3b8ab5f commit 3620088
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var appc = require('node-appc'),
series = appc.async.series,
version = appc.version;
var platformsRegExp = /^(android|ios|iphone|ipad|mobileweb|blackberry|windows|tizen)$/;
const pemCertRegExp = /(^-----BEGIN CERTIFICATE-----)|(-----END CERTIFICATE-----.*$)|\n/g;
var pemCertRegExp = /(^-----BEGIN CERTIFICATE-----)|(-----END CERTIFICATE-----.*$)|\n/g;

function iOSBuilder() {
Builder.apply(this, arguments);
Expand Down Expand Up @@ -201,7 +201,7 @@ iOSBuilder.prototype.assertIssue = function assertIssue(issues, name) {
* @access private
*/
iOSBuilder.prototype.findCertificates = function findCertificates(name, type) {
const certs = [];
var certs = [];
/* eslint-disable max-depth */
if (name && this.iosInfo) {
for (var keychain of Object.keys(this.iosInfo.certs.keychains)) {
Expand Down Expand Up @@ -1012,7 +1012,7 @@ iOSBuilder.prototype.configOptionPPuuid = function configOptionPPuuid(order) {
function prep(a, certs) {
return a.filter(function (p) {
if (!p.expired && !p.managed && (!certs || intersection(p.certs, certs).length > 0)) {
const re = new RegExp(p.appId.replace(/\./g, '\\.').replace(/\*/g, '.*')); // eslint-disable-line security/detect-non-literal-regexp
var re = new RegExp(p.appId.replace(/\./g, '\\.').replace(/\*/g, '.*')); // eslint-disable-line security/detect-non-literal-regexp
if (re.test(appId)) {
var label = p.name;
if (label.indexOf(p.appId) === -1) {
Expand All @@ -1028,14 +1028,14 @@ iOSBuilder.prototype.configOptionPPuuid = function configOptionPPuuid(order) {
});
}

let certs;
var certs;
if (target === 'device') {
certs = _t.findCertificates(cli.argv['developer-name'], 'developer');
} else {
certs = _t.findCertificates(cli.argv['distribution-name'], 'distribution');
}

const pems = certs.map(function (c) {
var pems = certs.map(function (c) {
return c.pem.replace(pemCertRegExp, '');
})

Expand Down Expand Up @@ -1082,7 +1082,7 @@ iOSBuilder.prototype.configOptionPPuuid = function configOptionPPuuid(order) {
} else if (target === 'dist-adhoc') {
if (iosInfo.provisioning.adhoc.length || iosInfo.provisioning.enterprise.length) {
pp = prep(iosInfo.provisioning.adhoc, pems);
let valid = pp.length;
var valid = pp.length;
if (pp.length) {
provisioningProfiles[__('Available Ad Hoc UUIDs:')] = pp;
}
Expand Down Expand Up @@ -1152,14 +1152,14 @@ iOSBuilder.prototype.configOptionPPuuid = function configOptionPPuuid(order) {
return callback(new Error(__('Specified provisioning profile UUID "%s" is expired', value)));
}

let certs;
var certs;
if (target === 'device') {
certs = _t.findCertificates(cli.argv['developer-name'], 'developer');
} else {
certs = _t.findCertificates(cli.argv['distribution-name'], 'distribution');
}

const pems = certs.map(function (c) {
var pems = certs.map(function (c) {
return c.pem.replace(pemCertRegExp, '');
})

Expand Down

0 comments on commit 3620088

Please sign in to comment.