This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
The following commit(s) were added to refs/heads/master by this push:
new 266d339 refactor: use template strings (#751)
266d339 is described below
commit 266d339ee80d381068f50065dfc132132ffd2e7f
Author: エリス <[email protected]>
AuthorDate: Mon Dec 30 20:50:26 2019 +0900
refactor: use template strings (#751)
---
bin/lib/create.js | 48 +++++++++---------
bin/templates/scripts/cordova/Api.js | 8 +--
.../scripts/cordova/lib/BridgingHeader.js | 6 +--
bin/templates/scripts/cordova/lib/Podfile.js | 8 +--
bin/templates/scripts/cordova/lib/build.js | 47 +++++++++---------
bin/templates/scripts/cordova/lib/check_reqs.js | 14 +++---
bin/templates/scripts/cordova/lib/clean.js | 2 +-
.../scripts/cordova/lib/plugman/pluginHandlers.js | 36 +++++++-------
bin/templates/scripts/cordova/lib/prepare.js | 57 +++++++++++-----------
bin/templates/scripts/cordova/lib/run.js | 16 +++---
bin/templates/scripts/cordova/lib/spawn.js | 2 +-
bin/templates/scripts/cordova/lib/versions.js | 2 +-
tests/scripts/killsim.js | 10 ++--
tests/spec/unit/Api.spec.js | 4 +-
tests/spec/unit/BridgingHeader.spec.js | 2 +-
tests/spec/unit/Plugman/common.spec.js | 10 ++--
tests/spec/unit/Plugman/pluginHandler.spec.js | 8 +--
tests/spec/unit/Podfile.spec.js | 2 +-
tests/spec/unit/build.spec.js | 26 +++++-----
tests/spec/unit/prepare.spec.js | 12 ++---
tests/spec/unit/preparePlatform.spec.js | 6 +--
21 files changed, 161 insertions(+), 165 deletions(-)
diff --git a/bin/lib/create.js b/bin/lib/create.js
index b143d10..f90105b 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -46,7 +46,7 @@ function copyJsAndCordovaLib (projectPath, projectName,
use_shared, config) {
}
} catch (e) { }
if (use_shared) {
- update_cordova_subproject([path.join(projectPath, projectName +
'.xcodeproj', 'project.pbxproj'), config]);
+ update_cordova_subproject([path.join(projectPath,
`${projectName}.xcodeproj`, 'project.pbxproj'), config]);
// Symlink not used in project file, but is currently required for
plugman because
// it reads the VERSION file from it (instead of using the
cordova/version script
// like it should).
@@ -60,7 +60,7 @@ function copyJsAndCordovaLib (projectPath, projectName,
use_shared, config) {
shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'),
path.join(projectPath, 'CordovaLib'));
shell.cp('-f', path.join(ROOT, 'CordovaLib', 'CordovaLib_Prefix.pch'),
path.join(projectPath, 'CordovaLib'));
shell.cp('-f', path.join(ROOT, 'CordovaLib', 'CordovaLib.xcodeproj',
'project.pbxproj'), path.join(projectPath, 'CordovaLib',
'CordovaLib.xcodeproj'));
- update_cordova_subproject([path.join(r + '.xcodeproj',
'project.pbxproj'), path.join(projectPath, 'CordovaLib',
'CordovaLib.xcodeproj', 'project.pbxproj'), config]);
+ update_cordova_subproject([path.join(`${r}.xcodeproj`,
'project.pbxproj'), path.join(projectPath, 'CordovaLib',
'CordovaLib.xcodeproj', 'project.pbxproj'), config]);
}
}
@@ -119,21 +119,21 @@ function copyScripts (projectPath, projectName) {
function copyTemplateFiles (project_path, project_name, project_template_dir,
package_name) {
const r = path.join(project_path, project_name);
- shell.rm('-rf', path.join(r + '.xcodeproj'));
+ shell.rm('-rf', path.join(`${r}.xcodeproj`));
shell.cp('-rf', path.join(project_template_dir, '__TEMP__.xcodeproj'),
project_path);
- shell.mv('-f', path.join(project_path, '__TEMP__.xcodeproj'), path.join(r
+ '.xcodeproj'));
+ shell.mv('-f', path.join(project_path, '__TEMP__.xcodeproj'),
path.join(`${r}.xcodeproj`));
- shell.rm('-rf', path.join(project_path, project_name + '.xcworkspace'));
+ shell.rm('-rf', path.join(project_path, `${project_name}.xcworkspace`));
shell.cp('-rf', path.join(project_template_dir, '__TEMP__.xcworkspace'),
project_path);
- shell.mv('-f', path.join(project_path, '__TEMP__.xcworkspace'),
path.join(r + '.xcworkspace'));
- shell.mv('-f', path.join(r + '.xcworkspace', 'xcshareddata', 'xcschemes',
'__PROJECT_NAME__.xcscheme'), path.join(r + '.xcworkspace', 'xcshareddata',
'xcschemes', project_name + '.xcscheme'));
+ shell.mv('-f', path.join(project_path, '__TEMP__.xcworkspace'),
path.join(`${r}.xcworkspace`));
+ shell.mv('-f', path.join(`${r}.xcworkspace`, 'xcshareddata', 'xcschemes',
'__PROJECT_NAME__.xcscheme'), path.join(`${r}.xcworkspace`, 'xcshareddata',
'xcschemes', `${project_name}.xcscheme`));
shell.rm('-rf', r);
shell.cp('-rf', path.join(project_template_dir, '__PROJECT_NAME__'),
project_path);
shell.mv('-f', path.join(project_path, '__PROJECT_NAME__'), r);
- shell.mv('-f', path.join(r, '__PROJECT_NAME__-Info.plist'), path.join(r,
project_name + '-Info.plist'));
- shell.mv('-f', path.join(r, '__PROJECT_NAME__-Prefix.pch'), path.join(r,
project_name + '-Prefix.pch'));
+ shell.mv('-f', path.join(r, '__PROJECT_NAME__-Info.plist'), path.join(r,
`${project_name}-Info.plist`));
+ shell.mv('-f', path.join(r, '__PROJECT_NAME__-Prefix.pch'), path.join(r,
`${project_name}-Prefix.pch`));
shell.mv('-f', path.join(r, 'gitignore'), path.join(r, '.gitignore'));
/* replace __PROJECT_NAME__ and __PROJECT_ID__ with ACTIVITY and ID
strings, respectively, in:
@@ -150,19 +150,19 @@ function copyTemplateFiles (project_path, project_name,
project_template_dir, pa
// https://issues.apache.org/jira/browse/CB-12402 - Encode XML characters
properly
const project_name_xml_esc = xmlescape(project_name);
- shell.sed('-i', /__PROJECT_NAME__/g, project_name_xml_esc, path.join(r +
'.xcworkspace', 'contents.xcworkspacedata'));
- shell.sed('-i', /__PROJECT_NAME__/g, project_name_xml_esc, path.join(r +
'.xcworkspace', 'xcshareddata', 'xcschemes', project_name + '.xcscheme'));
+ shell.sed('-i', /__PROJECT_NAME__/g, project_name_xml_esc,
path.join(`${r}.xcworkspace`, 'contents.xcworkspacedata'));
+ shell.sed('-i', /__PROJECT_NAME__/g, project_name_xml_esc,
path.join(`${r}.xcworkspace`, 'xcshareddata', 'xcschemes',
`${project_name}.xcscheme`));
const project_name_esc = project_name.replace(/&/g, '\\&');
- shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r +
'.xcodeproj', 'project.pbxproj'));
- shell.sed('-i', /__PROJECT_ID__/g, package_name, path.join(r +
'.xcodeproj', 'project.pbxproj'));
+ shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc,
path.join(`${r}.xcodeproj`, 'project.pbxproj'));
+ shell.sed('-i', /__PROJECT_ID__/g, package_name,
path.join(`${r}.xcodeproj`, 'project.pbxproj'));
shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
'Classes', 'AppDelegate.h'));
shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
'Classes', 'AppDelegate.m'));
shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
'Classes', 'MainViewController.h'));
shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
'Classes', 'MainViewController.m'));
shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
'main.m'));
- shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
project_name + '-Info.plist'));
- shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
project_name + '-Prefix.pch'));
+ shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
`${project_name}-Info.plist`));
+ shell.sed('-i', /__PROJECT_NAME__/g, project_name_esc, path.join(r,
`${project_name}-Prefix.pch`));
}
function AbsParentPath (_path) {
@@ -174,7 +174,7 @@ function AbsProjectPath (relative_path) {
if (/.pbxproj$/.test(absolute_path)) {
absolute_path = AbsParentPath(absolute_path);
} else if (!(/.xcodeproj$/.test(absolute_path))) {
- throw new Error('The following is not a valid path to an Xcode
project: ' + absolute_path);
+ throw new Error(`The following is not a valid path to an Xcode
project: ${absolute_path}`);
}
return absolute_path;
}
@@ -210,15 +210,15 @@ exports.createProject = (project_path, package_name,
project_name, opts, config)
// check that parent directory does exist so cp -r will not fail
if (!fs.existsSync(project_parent)) {
- return Q.reject('Parent directory "' + project_parent + '" of given
project path does not exist');
+ return Q.reject(`Parent directory "${project_parent}" of given project
path does not exist`);
}
events.emit('log', 'Creating Cordova project for the iOS platform:');
- events.emit('log', '\tPath: ' + path.relative(process.cwd(),
project_path));
- events.emit('log', '\tPackage: ' + package_name);
- events.emit('log', '\tName: ' + project_name);
+ events.emit('log', `\tPath: ${path.relative(process.cwd(),
project_path)}`);
+ events.emit('log', `\tPackage: ${package_name}`);
+ events.emit('log', `\tName: ${project_name}`);
- events.emit('verbose', 'Copying iOS template project to ' + project_path);
+ events.emit('verbose', `Copying iOS template project to ${project_path}`);
// create the project directory and copy over files
shell.mkdir(project_path);
@@ -253,7 +253,7 @@ exports.updateProject = (projectPath, opts) => {
function generateDoneMessage (type, link) {
const pkg = require('../../package');
- let msg = 'iOS project ' + (type === 'update' ? 'updated ' : 'created ') +
'with ' + pkg.name + '@' + pkg.version;
+ let msg = `iOS project ${type === 'update' ? 'updated' : 'created'} with
${pkg.name}@${pkg.version}`;
if (link) {
msg += ' and has a linked CordovaLib';
}
@@ -289,7 +289,7 @@ function update_cordova_subproject (argv) {
for (let i = 0; i < lines.length; ++i) {
if (lines[i].match(REGEX)) {
found = true;
- newLine = lines[i].replace(/path = .+?;/, 'path = ' +
subprojectPath + ';');
+ newLine = lines[i].replace(/path = .+?;/, `path =
${subprojectPath};`);
newLine = newLine.replace(/sourceTree.+?;/, 'sourceTree =
\"<group>\";'); /* eslint no-useless-escape : 0 */
if (!newLine.match('name')) {
newLine = newLine.replace('path = ', 'name =
CordovaLib.xcodeproj; path = ');
@@ -299,7 +299,7 @@ function update_cordova_subproject (argv) {
}
if (!found) {
- throw new Error('Entry not found in project file for sub-project: ' +
subprojectPath);
+ throw new Error(`Entry not found in project file for sub-project:
${subprojectPath}`);
}
const wkWebViewOnly = projectConfig.getPreference('WKWebViewOnly') ===
'true';
diff --git a/bin/templates/scripts/cordova/Api.js
b/bin/templates/scripts/cordova/Api.js
index 96cf784..9a0ffc3 100644
--- a/bin/templates/scripts/cordova/Api.js
+++ b/bin/templates/scripts/cordova/Api.js
@@ -81,13 +81,13 @@ function Api (platform, platformRootDir, events) {
xcodeProjDir = xcodeProjDir_array[0];
if (!xcodeProjDir) {
- throw new CordovaError('The provided path "' + this.root + '" is
not a Cordova iOS project.');
+ throw new CordovaError(`The provided path "${this.root}" is not a
Cordova iOS project.`);
}
const cordovaProjName =
xcodeProjDir.substring(xcodeProjDir.lastIndexOf(path.sep) + 1,
xcodeProjDir.indexOf('.xcodeproj'));
xcodeCordovaProj = path.join(this.root, cordovaProjName);
} catch (e) {
- throw new CordovaError('The provided path "' + this.root + '" is not a
Cordova iOS project.');
+ throw new CordovaError(`The provided path "${this.root}" is not a
Cordova iOS project.`);
}
this.locations = {
@@ -386,7 +386,7 @@ Api.prototype.addPodSpecs = function (plugin, podSpecs,
frameworkPods, installOp
}
const val = podsjsonFile.getLibrary(key);
if (val) {
- events.emit('warn', plugin.id + ' depends on ' +
podJson.name + ', which may conflict with another plugin. ' + podJson.name +
'@' + val.spec + ' is already installed and was not overwritten.');
+ events.emit('warn', `${plugin.id} depends on
${podJson.name}, which may conflict with another plugin.
${podJson.name}@${val.spec} is already installed and was not overwritten.`);
podsjsonFile.incrementLibrary(key);
} else {
podJson.count = 1;
@@ -411,7 +411,7 @@ Api.prototype.addPodSpecs = function (plugin, podSpecs,
frameworkPods, installOp
const val = podsjsonFile.getLibrary(podJson.name);
if (val) { // found
if (podJson.spec !== val.spec) { // exists, different spec,
print warning
- events.emit('warn', plugin.id + ' depends on ' +
podJson.name + '@' + podJson.spec + ', which conflicts with another plugin. ' +
podJson.name + '@' + val.spec + ' is already installed and was not
overwritten.');
+ events.emit('warn', `${plugin.id} depends on
${podJson.name}@${podJson.spec}, which conflicts with another plugin.
${podJson.name}@${val.spec} is already installed and was not overwritten.`);
}
// increment count, but don't add in Podfile because it
already exists
podsjsonFile.incrementLibrary(podJson.name);
diff --git a/bin/templates/scripts/cordova/lib/BridgingHeader.js
b/bin/templates/scripts/cordova/lib/BridgingHeader.js
index 33efe58..d9ebcbe 100644
--- a/bin/templates/scripts/cordova/lib/BridgingHeader.js
+++ b/bin/templates/scripts/cordova/lib/BridgingHeader.js
@@ -31,7 +31,7 @@ function BridgingHeader (bridgingHeaderPath) {
}
BridgingHeader.prototype.addHeader = function (plugin_id, header_path) {
- this.bridgingHeaders.push({ type: 'code', code: '#import "' + header_path
+ '"\n' });
+ this.bridgingHeaders.push({ type: 'code', code: `#import
"${header_path}"\n` });
};
BridgingHeader.prototype.removeHeader = function (plugin_id, header_path) {
@@ -40,7 +40,7 @@ BridgingHeader.prototype.removeHeader = function (plugin_id,
header_path) {
return true;
}
if (line.type === 'code') {
- const re = new RegExp('#import\\s+"' + preg_quote(header_path) +
'"(\\s*|\\s.+)(\\n|$)');
+ const re = new
RegExp(`#import\\s+"${preg_quote(header_path)}"(\\s*|\\s.+)(\\n|$)`);
if (re.test(line.code)) {
this.found = true;
return false;
@@ -117,7 +117,7 @@ BridgingHeader.prototype.__parseForBridgingHeader =
function (text) {
};
function preg_quote (str, delimiter) {
- return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' +
(delimiter || '') + '-]', 'g'), '\\$&');
+ return (`${str}`).replace(new
RegExp(`[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\${delimiter || ''}-]`, 'g'), '\\$&');
}
module.exports.BridgingHeader = BridgingHeader;
diff --git a/bin/templates/scripts/cordova/lib/Podfile.js
b/bin/templates/scripts/cordova/lib/Podfile.js
index 819df1f..e3ba690 100644
--- a/bin/templates/scripts/cordova/lib/Podfile.js
+++ b/bin/templates/scripts/cordova/lib/Podfile.js
@@ -309,17 +309,17 @@ Podfile.prototype.write = function () {
return util.format('\tpod \'%s\'', name);
}
} else {
- const list = ['\'' + name + '\''];
+ const list = [`'${name}'`];
if ('spec' in json && json.spec.length) {
- list.push('\'' + json.spec + '\'');
+ list.push(`'${json.spec}'`);
}
let options = ['tag', 'branch', 'commit', 'git', 'podspec']
.filter(tag => tag in json)
- .map(tag => ':' + tag + ' => \'' + json[tag] + '\'');
+ .map(tag => `:${tag} => '${json[tag]}'`);
if ('configurations' in json) {
- options.push(':configurations => [' +
json['configurations'].split(',').map(conf => '\'' + conf.trim() +
'\'').join(',') + ']');
+ options.push(`:configurations =>
[${json['configurations'].split(',').map(conf =>
`'${conf.trim()}'`).join(',')}]`);
}
if ('options' in json) {
options = [json.options];
diff --git a/bin/templates/scripts/cordova/lib/build.js
b/bin/templates/scripts/cordova/lib/build.js
index ffe9c7b..3cb19a9 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -54,7 +54,7 @@ const buildFlagMatchers = {
function createProjectObject (projectPath, projectName) {
const locations = {
root: projectPath,
- pbxproj: path.join(projectPath, projectName + '.xcodeproj',
'project.pbxproj')
+ pbxproj: path.join(projectPath, `${projectName}.xcodeproj`,
'project.pbxproj')
};
return projectFile.parse(locations);
@@ -120,9 +120,9 @@ module.exports.run = buildOpts => {
if (buildOpts.buildConfig) {
if (!fs.existsSync(buildOpts.buildConfig)) {
- return Q.reject('Build config file does not exist: ' +
buildOpts.buildConfig);
+ return Q.reject(`Build config file does not exist:
${buildOpts.buildConfig}`);
}
- events.emit('log', 'Reading build config file: ' +
path.resolve(buildOpts.buildConfig));
+ events.emit('log', `Reading build config file:
${path.resolve(buildOpts.buildConfig)}`);
const contents = fs.readFileSync(buildOpts.buildConfig, 'utf-8');
const buildConfig = JSON.parse(contents.replace(/^\ufeff/, '')); //
Remove BOM
if (buildConfig.ios) {
@@ -178,17 +178,17 @@ module.exports.run = buildOpts => {
projectName = name;
let extraConfig = '';
if (buildOpts.codeSignIdentity) {
- extraConfig += 'CODE_SIGN_IDENTITY = ' +
buildOpts.codeSignIdentity + '\n';
- extraConfig += 'CODE_SIGN_IDENTITY[sdk=iphoneos*] = ' +
buildOpts.codeSignIdentity + '\n';
+ extraConfig += `CODE_SIGN_IDENTITY =
${buildOpts.codeSignIdentity}\n`;
+ extraConfig += `CODE_SIGN_IDENTITY[sdk=iphoneos*] =
${buildOpts.codeSignIdentity}\n`;
}
if (buildOpts.codeSignResourceRules) {
- extraConfig += 'CODE_SIGN_RESOURCE_RULES_PATH = ' +
buildOpts.codeSignResourceRules + '\n';
+ extraConfig += `CODE_SIGN_RESOURCE_RULES_PATH =
${buildOpts.codeSignResourceRules}\n`;
}
if (buildOpts.provisioningProfile) {
- extraConfig += 'PROVISIONING_PROFILE = ' +
buildOpts.provisioningProfile + '\n';
+ extraConfig += `PROVISIONING_PROFILE =
${buildOpts.provisioningProfile}\n`;
}
if (buildOpts.developmentTeam) {
- extraConfig += 'DEVELOPMENT_TEAM = ' +
buildOpts.developmentTeam + '\n';
+ extraConfig += `DEVELOPMENT_TEAM =
${buildOpts.developmentTeam}\n`;
}
function writeCodeSignStyle (value) {
@@ -214,10 +214,10 @@ module.exports.run = buildOpts => {
}).then(() => {
const configuration = buildOpts.release ? 'Release' : 'Debug';
- events.emit('log', 'Building project: ' + path.join(projectPath,
projectName + '.xcworkspace'));
- events.emit('log', '\tConfiguration: ' + configuration);
- events.emit('log', '\tPlatform: ' + (buildOpts.device ? 'device' :
'emulator'));
- events.emit('log', '\tTarget: ' + emulatorTarget);
+ events.emit('log', `Building project: ${path.join(projectPath,
`${projectName}.xcworkspace`)}`);
+ events.emit('log', `\tConfiguration: ${configuration}`);
+ events.emit('log', `\tPlatform: ${buildOpts.device ? 'device' :
'emulator'}`);
+ events.emit('log', `\tTarget: ${emulatorTarget}`);
const buildOutputDir = path.join(projectPath, 'build',
(buildOpts.device ? 'device' : 'emulator'));
@@ -292,11 +292,10 @@ function findXCodeProjectIn (projectPath) {
const xcodeProjFiles = shell.ls(projectPath).filter(name =>
path.extname(name) === '.xcodeproj');
if (xcodeProjFiles.length === 0) {
- return Q.reject('No Xcode project found in ' + projectPath);
+ return Q.reject(`No Xcode project found in ${projectPath}`);
}
if (xcodeProjFiles.length > 1) {
- events.emit('warn', 'Found multiple .xcodeproj directories in \n' +
- projectPath + '\nUsing first one');
+ events.emit('warn', `Found multiple .xcodeproj directories in
\n${projectPath}\nUsing first one`);
}
const projectName = path.basename(xcodeProjFiles[0], '.xcodeproj');
@@ -335,16 +334,16 @@ function getXcodeBuildArgs (projectName, projectPath,
configuration, isDevice, b
if (isDevice) {
options = [
- '-workspace', customArgs.workspace || projectName + '.xcworkspace',
+ '-workspace', customArgs.workspace || `${projectName}.xcworkspace`,
'-scheme', customArgs.scheme || projectName,
'-configuration', customArgs.configuration || configuration,
'-destination', customArgs.destination || 'generic/platform=iOS',
- '-archivePath', customArgs.archivePath || projectName +
'.xcarchive'
+ '-archivePath', customArgs.archivePath ||
`${projectName}.xcarchive`
];
buildActions = ['archive'];
settings = [
- customArgs.configuration_build_dir || 'CONFIGURATION_BUILD_DIR=' +
path.join(projectPath, 'build', 'device'),
- customArgs.shared_precomps_dir || 'SHARED_PRECOMPS_DIR=' +
path.join(projectPath, 'build', 'sharedpch')
+ customArgs.configuration_build_dir ||
`CONFIGURATION_BUILD_DIR=${path.join(projectPath, 'build', 'device')}`,
+ customArgs.shared_precomps_dir ||
`SHARED_PRECOMPS_DIR=${path.join(projectPath, 'build', 'sharedpch')}`
];
// Add other matched flags to otherFlags to let xcodebuild present an
appropriate error.
// This is preferable to just ignoring the flags that the user has
passed in.
@@ -357,16 +356,16 @@ function getXcodeBuildArgs (projectName, projectPath,
configuration, isDevice, b
}
} else { // emulator
options = [
- '-workspace', customArgs.project || projectName + '.xcworkspace',
+ '-workspace', customArgs.project || `${projectName}.xcworkspace`,
'-scheme', customArgs.scheme || projectName,
'-configuration', customArgs.configuration || configuration,
'-sdk', customArgs.sdk || 'iphonesimulator',
- '-destination', customArgs.destination || 'platform=iOS
Simulator,name=' + emulatorTarget
+ '-destination', customArgs.destination || `platform=iOS
Simulator,name=${emulatorTarget}`
];
buildActions = ['build'];
settings = [
- customArgs.configuration_build_dir || 'CONFIGURATION_BUILD_DIR=' +
path.join(projectPath, 'build', 'emulator'),
- customArgs.shared_precomps_dir || 'SHARED_PRECOMPS_DIR=' +
path.join(projectPath, 'build', 'sharedpch')
+ customArgs.configuration_build_dir ||
`CONFIGURATION_BUILD_DIR=${path.join(projectPath, 'build', 'emulator')}`,
+ customArgs.shared_precomps_dir ||
`SHARED_PRECOMPS_DIR=${path.join(projectPath, 'build', 'sharedpch')}`
];
// Add other matched flags to otherFlags to let xcodebuild present an
appropriate error.
// This is preferable to just ignoring the flags that the user has
passed in.
@@ -390,7 +389,7 @@ function getXcodeBuildArgs (projectName, projectPath,
configuration, isDevice, b
function getXcodeArchiveArgs (projectName, projectPath, outputPath,
exportOptionsPath, autoProvisioning) {
return [
'-exportArchive',
- '-archivePath', projectName + '.xcarchive',
+ '-archivePath', `${projectName}.xcarchive`,
'-exportOptionsPlist', exportOptionsPath,
'-exportPath', outputPath
].concat(autoProvisioning ? ['-allowProvisioningUpdates'] : []);
diff --git a/bin/templates/scripts/cordova/lib/check_reqs.js
b/bin/templates/scripts/cordova/lib/check_reqs.js
index 6e75ba0..8eb091e 100644
--- a/bin/templates/scripts/cordova/lib/check_reqs.js
+++ b/bin/templates/scripts/cordova/lib/check_reqs.js
@@ -28,21 +28,20 @@ const SUPPORTED_OS_PLATFORMS = ['darwin'];
const XCODEBUILD_MIN_VERSION = '9.0.0';
const XCODEBUILD_NOT_FOUND_MESSAGE =
- 'Please install version ' + XCODEBUILD_MIN_VERSION + ' or greater from App
Store';
+ `Please install version ${XCODEBUILD_MIN_VERSION} or greater from App
Store`;
const IOS_DEPLOY_MIN_VERSION = '1.9.2';
const IOS_DEPLOY_NOT_FOUND_MESSAGE =
- 'Please download, build and install version ' + IOS_DEPLOY_MIN_VERSION + '
or greater' +
- ' from https://github.com/ios-control/ios-deploy into your path, or do
\'npm install -g ios-deploy\'';
+ `Please download, build and install version ${IOS_DEPLOY_MIN_VERSION} or
greater from https://github.com/ios-control/ios-deploy into your path, or do
'npm install -g ios-deploy'`;
const COCOAPODS_MIN_VERSION = '1.0.1';
const COCOAPODS_NOT_FOUND_MESSAGE =
- 'Please install version ' + COCOAPODS_MIN_VERSION + ' or greater from
https://cocoapods.org/';
+ `Please install version ${COCOAPODS_MIN_VERSION} or greater from
https://cocoapods.org/`;
const COCOAPODS_NOT_SYNCED_MESSAGE =
'The CocoaPods repo has not been synced yet, this will take a long time
(approximately 500MB as of Sept 2016). Please run `pod setup` first to sync the
repo.';
const COCOAPODS_SYNCED_MIN_SIZE = 475; // in megabytes
const COCOAPODS_SYNC_ERROR_MESSAGE =
- 'The CocoaPods repo has been created, but there appears to be a sync
error. The repo size should be at least ' + COCOAPODS_SYNCED_MIN_SIZE + '.
Please run `pod setup --verbose` to sync the repo.';
+ `The CocoaPods repo has been created, but there appears to be a sync
error. The repo size should be at least ${COCOAPODS_SYNCED_MIN_SIZE}. Please
run \`pod setup --verbose\` to sync the repo.`;
const COCOAPODS_REPO_NOT_FOUND_MESSAGE = 'The CocoaPods repo at ~/.cocoapods
was not found.';
/**
@@ -155,7 +154,7 @@ function checkTool (tool, minVersion, message,
toolFriendlyName) {
// Check whether tool command is available at all
const tool_command = shell.which(tool);
if (!tool_command) {
- return Q.reject(toolFriendlyName + ' was not found. ' + (message ||
''));
+ return Q.reject(`${toolFriendlyName} was not found. ${message || ''}`);
}
// check if tool version is greater than specified one
@@ -163,8 +162,7 @@ function checkTool (tool, minVersion, message,
toolFriendlyName) {
version = version.trim();
return versions.compareVersions(version, minVersion) >= 0
? Q.resolve({ version })
- : Q.reject('Cordova needs ' + toolFriendlyName + ' version ' +
minVersion +
- ' or greater, you have version ' + version + '. ' + (message ||
''));
+ : Q.reject(`Cordova needs ${toolFriendlyName} version
${minVersion} or greater, you have version ${version}. ${message || ''}`);
});
}
diff --git a/bin/templates/scripts/cordova/lib/clean.js
b/bin/templates/scripts/cordova/lib/clean.js
index 1731240..d2c7803 100644
--- a/bin/templates/scripts/cordova/lib/clean.js
+++ b/bin/templates/scripts/cordova/lib/clean.js
@@ -28,7 +28,7 @@ module.exports.run = () => {
const projectName = shell.ls(projectPath).filter(name =>
path.extname(name) === '.xcodeproj')[0];
if (!projectName) {
- return Q.reject('No Xcode project found in ' + projectPath);
+ return Q.reject(`No Xcode project found in ${projectPath}`);
}
const xcodebuildClean = configName => {
diff --git a/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js
b/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js
index 50d00f3..ca428dd 100644
--- a/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js
+++ b/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js
@@ -58,10 +58,10 @@ const handlers = {
const destFile = path.resolve(project.resources_dir, target);
if (!fs.existsSync(srcFile)) {
- throw new CordovaError('Cannot find resource file "' + srcFile
+ '" for plugin ' + plugin.id + ' in iOS platform');
+ throw new CordovaError(`Cannot find resource file "${srcFile}"
for plugin ${plugin.id} in iOS platform`);
}
if (fs.existsSync(destFile)) {
- throw new CordovaError('File already exists at destination "'
+ destFile + '" for resource file specified by plugin ' + plugin.id + ' in iOS
platform');
+ throw new CordovaError(`File already exists at destination
"${destFile}" for resource file specified by plugin ${plugin.id} in iOS
platform`);
}
project.xcode.addResourceFile(path.join('Resources', target));
const link = !!(options && options.link);
@@ -106,8 +106,8 @@ const handlers = {
}
const srcFile = path.resolve(plugin.dir, src);
const targetDir = path.resolve(project.plugins_dir, plugin.id,
path.basename(src));
- if (!fs.existsSync(srcFile)) throw new CordovaError('Cannot find
framework "' + srcFile + '" for plugin ' + plugin.id + ' in iOS platform');
- if (fs.existsSync(targetDir)) throw new CordovaError('Framework "'
+ targetDir + '" for plugin ' + plugin.id + ' already exists in iOS platform');
+ if (!fs.existsSync(srcFile)) throw new CordovaError(`Cannot find
framework "${srcFile}" for plugin ${plugin.id} in iOS platform`);
+ if (fs.existsSync(targetDir)) throw new CordovaError(`Framework
"${targetDir}" for plugin ${plugin.id} already exists in iOS platform`);
const symlink = !!(options && options.link);
copyFile(plugin.dir, src, project.projectDir, targetDir, symlink);
// frameworks are directories
// CB-10773 translate back slashes to forward on win32
@@ -191,14 +191,14 @@ const handlers = {
install: function (obj, plugin, project, options) {
// Copy the plugin's files into the www directory.
const moduleSource = path.resolve(plugin.dir, obj.src);
- const moduleName = plugin.id + '.' + (obj.name ||
path.basename(obj.src, path.extname(obj.src)));
+ const moduleName = `${plugin.id}.${obj.name ||
path.basename(obj.src, path.extname(obj.src))}`;
// Read in the file, prepend the cordova.define, and write it back
out.
let scriptContent = fs.readFileSync(moduleSource,
'utf-8').replace(/^\ufeff/, ''); // Window BOM
if (moduleSource.match(/.*\.json$/)) {
- scriptContent = 'module.exports = ' + scriptContent;
+ scriptContent = `module.exports = ${scriptContent}`;
}
- scriptContent = 'cordova.define("' + moduleName + '",
function(require, exports, module) {\n' + scriptContent + '\n});\n';
+ scriptContent = `cordova.define("${moduleName}", function(require,
exports, module) {\n${scriptContent}\n});\n`;
const moduleDestination = path.resolve(project.www, 'plugins',
plugin.id, obj.src);
shell.mkdir('-p', path.dirname(moduleDestination));
@@ -222,7 +222,7 @@ module.exports.getInstaller = type => {
return handlers[type].install;
}
- events.emit('warn', '<' + type + '> is not supported for iOS plugins');
+ events.emit('warn', `<${type}> is not supported for iOS plugins`);
};
module.exports.getUninstaller = type => {
@@ -230,7 +230,7 @@ module.exports.getUninstaller = type => {
return handlers[type].uninstall;
}
- events.emit('warn', '<' + type + '> is not supported for iOS plugins');
+ events.emit('warn', `<${type}> is not supported for iOS plugins`);
};
function installHelper (type, obj, plugin_dir, project_dir, plugin_id,
options, project) {
@@ -252,14 +252,14 @@ function installHelper (type, obj, plugin_dir,
project_dir, plugin_id, options,
// Make the Xcode reference the file directly.
// Note: Can't use path.join() here since it collapses 'Plugins/..',
and xcode
// library special-cases Plugins/ prefix.
- project_ref = 'Plugins/' +
fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc));
+ project_ref =
`Plugins/${fixPathSep(path.relative(fs.realpathSync(project.plugins_dir),
trueSrc))}`;
} else {
if (options && options.force) {
copyFile(plugin_dir, srcFile, project_dir, destFile, link);
} else {
copyNewFile(plugin_dir, srcFile, project_dir, destFile, link);
}
- project_ref = 'Plugins/' +
fixPathSep(path.relative(project.plugins_dir, destFile));
+ project_ref = `Plugins/${fixPathSep(path.relative(project.plugins_dir,
destFile))}`;
}
if (type === 'header-file') {
@@ -282,9 +282,9 @@ function uninstallHelper (type, obj, project_dir,
plugin_id, options, project) {
const link = !!(options && options.link);
if (link) {
const trueSrc = fs.readlinkSync(destFile);
- project_ref = 'Plugins/' +
fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc));
+ project_ref =
`Plugins/${fixPathSep(path.relative(fs.realpathSync(project.plugins_dir),
trueSrc))}`;
} else {
- project_ref = 'Plugins/' +
fixPathSep(path.relative(project.plugins_dir, destFile));
+ project_ref = `Plugins/${fixPathSep(path.relative(project.plugins_dir,
destFile))}`;
}
shell.rm('-rf', targetDir);
@@ -307,17 +307,17 @@ function fixPathSep (file) {
function copyFile (plugin_dir, src, project_dir, dest, link) {
src = path.resolve(plugin_dir, src);
- if (!fs.existsSync(src)) throw new CordovaError('"' + src + '" not
found!');
+ if (!fs.existsSync(src)) throw new CordovaError(`"${src}" not found!`);
// check that src path is inside plugin directory
const real_path = fs.realpathSync(src);
const real_plugin_path = fs.realpathSync(plugin_dir);
- if (real_path.indexOf(real_plugin_path) !== 0) { throw new
CordovaError('File "' + src + '" is located outside the plugin directory "' +
plugin_dir + '"'); }
+ if (real_path.indexOf(real_plugin_path) !== 0) { throw new
CordovaError(`File "${src}" is located outside the plugin directory
"${plugin_dir}"`); }
dest = path.resolve(project_dir, dest);
// check that dest path is located in project directory
- if (dest.indexOf(project_dir) !== 0) { throw new CordovaError('Destination
"' + dest + '" for source file "' + src + '" is located outside the project'); }
+ if (dest.indexOf(project_dir) !== 0) { throw new CordovaError(`Destination
"${dest}" for source file "${src}" is located outside the project`); }
shell.mkdir('-p', path.dirname(dest));
@@ -334,7 +334,7 @@ function copyFile (plugin_dir, src, project_dir, dest,
link) {
// Same as copy file but throws error if target exists
function copyNewFile (plugin_dir, src, project_dir, dest, link) {
const target_path = path.resolve(project_dir, dest);
- if (fs.existsSync(target_path)) { throw new CordovaError('"' + target_path
+ '" already exists!'); }
+ if (fs.existsSync(target_path)) { throw new CordovaError(`"${target_path}"
already exists!`); }
copyFile(plugin_dir, src, project_dir, dest, !!link);
}
@@ -387,5 +387,5 @@ function removeFileAndParents (baseDir, destFile, stopper) {
}
function generateAttributeError (attribute, element, id) {
- return 'Required attribute "' + attribute + '" not specified in <' +
element + '> element from plugin: ' + id;
+ return `Required attribute "${attribute}" not specified in <${element}>
element from plugin: ${id}`;
}
diff --git a/bin/templates/scripts/cordova/lib/prepare.js
b/bin/templates/scripts/cordova/lib/prepare.js
index 255b8b9..441a228 100644
--- a/bin/templates/scripts/cordova/lib/prepare.js
+++ b/bin/templates/scripts/cordova/lib/prepare.js
@@ -103,7 +103,7 @@ module.exports.clean = function (options) {
* configuration is already dumped to appropriate config.xml file.
*/
function updateConfigFile (sourceConfig, configMunger, locations) {
- events.emit('verbose', 'Generating platform-specific config.xml from
defaults for iOS at ' + locations.configXml);
+ events.emit('verbose', `Generating platform-specific config.xml from
defaults for iOS at ${locations.configXml}`);
// First cleanup current config and merge project's one into own
// Overwrite platform config.xml with defaults.xml.
@@ -127,7 +127,7 @@ function updateConfigFile (sourceConfig, configMunger,
locations) {
* Logs all file operations via the verbose event stream, indented.
*/
function logFileOp (message) {
- events.emit('verbose', ' ' + message);
+ events.emit('verbose', ` ${message}`);
}
/**
@@ -154,7 +154,7 @@ function updateWww (cordovaProject, destinations) {
const targetDir = path.relative(cordovaProject.root, destinations.www);
events.emit(
- 'verbose', 'Merging and updating files from [' + sourceDirs.join(', ')
+ '] to ' + targetDir);
+ 'verbose', `Merging and updating files from [${sourceDirs.join(', ')}]
to ${targetDir}`);
FileUpdater.mergeAndUpdateDir(
sourceDirs, targetDir, { rootDir: cordovaProject.root }, logFileOp);
}
@@ -164,7 +164,7 @@ function updateWww (cordovaProject, destinations) {
*/
function cleanWww (projectRoot, locations) {
const targetDir = path.relative(projectRoot, locations.www);
- events.emit('verbose', 'Cleaning ' + targetDir);
+ events.emit('verbose', `Cleaning ${targetDir}`);
// No source paths are specified, so mergeAndUpdateDir() will clear the
target directory.
FileUpdater.mergeAndUpdateDir(
@@ -189,7 +189,7 @@ function updateProject (platformConfig, locations) {
const originalName = path.basename(locations.xcodeCordovaProj);
// Update package id (bundle id)
- const plistFile = path.join(locations.xcodeCordovaProj, originalName +
'-Info.plist');
+ const plistFile = path.join(locations.xcodeCordovaProj,
`${originalName}-Info.plist`);
const infoPlist = plist.parse(fs.readFileSync(plistFile, 'utf8'));
// Update version (bundle version)
@@ -223,11 +223,11 @@ function updateProject (platformConfig, locations) {
info_contents = info_contents.replace(/<string>[\s\r\n]*<\/string>/g,
'<string></string>');
fs.writeFileSync(plistFile, info_contents, 'utf-8');
- events.emit('verbose', 'Wrote out iOS Bundle Version "' + version + '" to
' + plistFile);
+ events.emit('verbose', `Wrote out iOS Bundle Version "${version}" to
${plistFile}`);
return handleBuildSettings(platformConfig, locations, infoPlist).then(()
=> {
if (name === originalName) {
- events.emit('verbose', 'iOS Product Name has not changed (still "'
+ originalName + '")');
+ events.emit('verbose', `iOS Product Name has not changed (still
"${originalName}")`);
return Q();
} else { // CB-11712 <name> was changed, we don't support it'
const errorString =
@@ -280,7 +280,7 @@ function handleBuildSettings (platformConfig, locations,
infoPlist) {
try {
project = projectFile.parse(locations);
} catch (err) {
- return Q.reject(new CordovaError('Could not parse ' +
locations.pbxproj + ': ' + err));
+ return Q.reject(new CordovaError(`Could not parse
${locations.pbxproj}: ${err}`));
}
const origPkg =
project.xcode.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER');
@@ -292,22 +292,22 @@ function handleBuildSettings (platformConfig, locations,
infoPlist) {
}
if (origPkg !== pkg) {
- events.emit('verbose', 'Set PRODUCT_BUNDLE_IDENTIFIER to ' + pkg +
'.');
+ events.emit('verbose', `Set PRODUCT_BUNDLE_IDENTIFIER to ${pkg}.`);
project.xcode.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', pkg);
}
if (targetDevice) {
- events.emit('verbose', 'Set TARGETED_DEVICE_FAMILY to ' + targetDevice
+ '.');
+ events.emit('verbose', `Set TARGETED_DEVICE_FAMILY to
${targetDevice}.`);
project.xcode.updateBuildProperty('TARGETED_DEVICE_FAMILY',
targetDevice);
}
if (deploymentTarget) {
- events.emit('verbose', 'Set IPHONEOS_DEPLOYMENT_TARGET to "' +
deploymentTarget + '".');
+ events.emit('verbose', `Set IPHONEOS_DEPLOYMENT_TARGET to
"${deploymentTarget}".`);
project.xcode.updateBuildProperty('IPHONEOS_DEPLOYMENT_TARGET',
deploymentTarget);
}
if (swiftVersion) {
- events.emit('verbose', 'Set SwiftVersion to "' + swiftVersion + '".');
+ events.emit('verbose', `Set SwiftVersion to "${swiftVersion}".`);
project.xcode.updateBuildProperty('SWIFT_VERSION', swiftVersion);
}
if (wkWebViewOnly) {
@@ -400,7 +400,7 @@ function updateIcons (cordovaProject, locations) {
const platformProjDir = path.relative(cordovaProject.root,
locations.xcodeCordovaProj);
const iconsDir = getIconsDir(cordovaProject.root, platformProjDir);
const resourceMap = mapIconResources(icons, iconsDir);
- events.emit('verbose', 'Updating icons at ' + iconsDir);
+ events.emit('verbose', `Updating icons at ${iconsDir}`);
FileUpdater.updatePaths(
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
}
@@ -414,7 +414,7 @@ function cleanIcons (projectRoot, projectConfig, locations)
{
Object.keys(resourceMap).forEach(targetIconPath => {
resourceMap[targetIconPath] = null;
});
- events.emit('verbose', 'Cleaning icons at ' + iconsDir);
+ events.emit('verbose', `Cleaning icons at ${iconsDir}`);
// Source paths are removed from the map, so updatePaths() will delete
the target files.
FileUpdater.updatePaths(
@@ -473,7 +473,7 @@ function updateSplashScreens (cordovaProject, locations) {
const platformProjDir = path.relative(cordovaProject.root,
locations.xcodeCordovaProj);
const splashScreensDir = getSplashScreensDir(cordovaProject.root,
platformProjDir);
const resourceMap = mapSplashScreenResources(splashScreens,
splashScreensDir);
- events.emit('verbose', 'Updating splash screens at ' + splashScreensDir);
+ events.emit('verbose', `Updating splash screens at ${splashScreensDir}`);
FileUpdater.updatePaths(
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
}
@@ -487,7 +487,7 @@ function cleanSplashScreens (projectRoot, projectConfig,
locations) {
Object.keys(resourceMap).forEach(targetSplashPath => {
resourceMap[targetSplashPath] = null;
});
- events.emit('verbose', 'Cleaning splash screens at ' +
splashScreensDir);
+ events.emit('verbose', `Cleaning splash screens at
${splashScreensDir}`);
// Source paths are removed from the map, so updatePaths() will delete
the target files.
FileUpdater.updatePaths(
@@ -522,13 +522,13 @@ function updateFileResources (cordovaProject, locations) {
if (!fs.existsSync(targetPath)) {
project.xcode.addResourceFile(target);
} else {
- events.emit('warn', 'Overwriting existing resource file at ' +
targetPath);
+ events.emit('warn', `Overwriting existing resource file at
${targetPath}`);
}
resourceMap[targetPath] = src;
});
- events.emit('verbose', 'Updating resource files at ' + platformDir);
+ events.emit('verbose', `Updating resource files at ${platformDir}`);
FileUpdater.updatePaths(
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
@@ -539,7 +539,7 @@ function cleanFileResources (projectRoot, projectConfig,
locations) {
const platformDir = path.relative(projectRoot, locations.root);
const files = projectConfig.getFileResources('ios', true);
if (files.length > 0) {
- events.emit('verbose', 'Cleaning resource files at ' + platformDir);
+ events.emit('verbose', `Cleaning resource files at ${platformDir}`);
const project = projectFile.parse(locations);
@@ -614,7 +614,7 @@ function mapLaunchStoryboardContents (splashScreens,
launchStoryboardImagesDir)
* @3x ~ iphone ~ com any
* @2x ~ ipad ~ com any
*/
- const searchPattern = '@' + scale + '~' + idiom + '~' +
width + height;
+ const searchPattern =
`@${scale}~${idiom}~${width}${height}`;
/* because old node versions don't have Array.find, the
below is
* functionally equivalent to this:
@@ -628,7 +628,7 @@ function mapLaunchStoryboardContents (splashScreens,
launchStoryboardImagesDir)
);
if (launchStoryboardImage) {
- item.filename = 'Default' + searchPattern + '.png';
+ item.filename = `Default${searchPattern}.png`;
item.src = launchStoryboardImage.src;
item.target = path.join(launchStoryboardImagesDir,
item.filename);
}
@@ -758,11 +758,11 @@ function updateBuildSettingsForLaunchStoryboard (proj,
platformConfig, infoPlist
if (hasLaunchStoryboardImages && currentLaunchStoryboard ===
CDV_LAUNCH_STORYBOARD_NAME && !hasLegacyLaunchImages) {
// don't need legacy launch images if we are using our launch
storyboard
- events.emit('verbose', 'Removed ' + LAUNCHIMAGE_BUILD_SETTING + '
because project is using our launch storyboard.');
+ events.emit('verbose', `Removed ${LAUNCHIMAGE_BUILD_SETTING} because
project is using our launch storyboard.`);
proj.removeBuildProperty(LAUNCHIMAGE_BUILD_SETTING);
} else if (hasLegacyLaunchImages && !currentLaunchStoryboard) {
// we do need to ensure legacy launch images are used if there's no
launch storyboard present
- events.emit('verbose', 'Set ' + LAUNCHIMAGE_BUILD_SETTING + ' to ' +
LAUNCHIMAGE_BUILD_SETTING_VALUE + ' because project is using legacy launch
images and no storyboard.');
+ events.emit('verbose', `Set ${LAUNCHIMAGE_BUILD_SETTING} to
${LAUNCHIMAGE_BUILD_SETTING_VALUE} because project is using legacy launch
images and no storyboard.`);
proj.updateBuildProperty(LAUNCHIMAGE_BUILD_SETTING,
LAUNCHIMAGE_BUILD_SETTING_VALUE);
} else {
events.emit('verbose', 'Did not update build settings for launch
storyboard support.');
@@ -801,7 +801,7 @@ function platformHasLegacyLaunchImages (platformConfig) {
*/
function updateProjectPlistForLaunchStoryboard (platformConfig, infoPlist) {
const currentLaunchStoryboard = infoPlist[UI_LAUNCH_STORYBOARD_NAME];
- events.emit('verbose', 'Current launch storyboard ' +
currentLaunchStoryboard);
+ events.emit('verbose', `Current launch storyboard
${currentLaunchStoryboard}`);
const hasLaunchStoryboardImages =
platformHasLaunchStoryboardImages(platformConfig);
@@ -860,7 +860,7 @@ function updateLaunchStoryboardImages (cordovaProject,
locations) {
const resourceMap = mapLaunchStoryboardResources(splashScreens,
launchStoryboardImagesDir);
const contentsJSON = getLaunchStoryboardContentsJSON(splashScreens,
launchStoryboardImagesDir);
- events.emit('verbose', 'Updating launch storyboard images at ' +
launchStoryboardImagesDir);
+ events.emit('verbose', `Updating launch storyboard images at
${launchStoryboardImagesDir}`);
FileUpdater.updatePaths(
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
@@ -889,7 +889,7 @@ function cleanLaunchStoryboardImages (projectRoot,
projectConfig, locations) {
Object.keys(resourceMap).forEach(targetPath => {
resourceMap[targetPath] = null;
});
- events.emit('verbose', 'Cleaning storyboard image set at ' +
launchStoryboardImagesDir);
+ events.emit('verbose', `Cleaning storyboard image set at
${launchStoryboardImagesDir}`);
// Source paths are removed from the map, so updatePaths() will delete
the target files.
FileUpdater.updatePaths(
@@ -930,8 +930,7 @@ function getOrientationValue (platformConfig) {
return orientation;
}
- events.emit('warn', 'Unrecognized value for Orientation preference: ' +
orientation +
- '. Defaulting to value: ' + ORIENTATION_DEFAULT + '.');
+ events.emit('warn', `Unrecognized value for Orientation preference:
${orientation}. Defaulting to value: ${ORIENTATION_DEFAULT}.`);
return ORIENTATION_DEFAULT;
}
@@ -1167,6 +1166,6 @@ function parseTargetDevicePreference (value) {
if (map[value.toLowerCase()]) {
return map[value.toLowerCase()];
}
- events.emit('warn', 'Unrecognized value for target-device preference: ' +
value + '.');
+ events.emit('warn', `Unrecognized value for target-device preference:
${value}.`);
return null;
}
diff --git a/bin/templates/scripts/cordova/lib/run.js
b/bin/templates/scripts/cordova/lib/run.js
index 279b99a..aff43f7 100644
--- a/bin/templates/scripts/cordova/lib/run.js
+++ b/bin/templates/scripts/cordova/lib/run.js
@@ -63,7 +63,7 @@ module.exports.run = runOptions => {
}
}).then(() => build.findXCodeProjectIn(projectPath))
.then(projectName => {
- let appPath = path.join(projectPath, 'build', 'emulator',
projectName + '.app');
+ let appPath = path.join(projectPath, 'build', 'emulator',
`${projectName}.app`);
const buildOutputDir = path.join(projectPath, 'build', 'device');
// select command to run and arguments depending whether
@@ -72,15 +72,15 @@ module.exports.run = runOptions => {
return module.exports.checkDeviceConnected()
.then(() => {
// Unpack IPA
- const ipafile = path.join(buildOutputDir, projectName
+ '.ipa');
+ const ipafile = path.join(buildOutputDir,
`${projectName}.ipa`);
// unpack the existing
platform/ios/build/device/appname.ipa (zipfile), will create a Payload folder
return superspawn.spawn('unzip', ['-o', '-qq',
ipafile], { cwd: buildOutputDir, printCommand: true, stdio: 'inherit' });
})
.then(() => {
// Uncompress IPA (zip file)
- const appFileInflated = path.join(buildOutputDir,
'Payload', projectName + '.app');
- const appFile = path.join(buildOutputDir, projectName
+ '.app');
+ const appFileInflated = path.join(buildOutputDir,
'Payload', `${projectName}.app`);
+ const appFile = path.join(buildOutputDir,
`${projectName}.app`);
const payloadFolder = path.join(buildOutputDir,
'Payload');
// delete the existing
platform/ios/build/device/appname.app
@@ -94,7 +94,7 @@ module.exports.run = runOptions => {
})
.then(
() => {
- appPath = path.join(projectPath, 'build',
'device', projectName + '.app');
+ appPath = path.join(projectPath, 'build',
'device', `${projectName}.app`);
let extraArgs = [];
if (runOptions.argv) {
// argv.slice(2) removes node and run.js,
filterSupportedArgs removes the run.js args
@@ -195,7 +195,7 @@ function deployToSim (appPath, target) {
function startSim (appPath, target) {
const logPath = path.join(cordovaPath, 'console.log');
- return iossimLaunch(appPath, 'com.apple.CoreSimulator.SimDeviceType.' +
target, logPath, '--exit');
+ return iossimLaunch(appPath,
`com.apple.CoreSimulator.SimDeviceType.${target}`, logPath, '--exit');
}
function iossimLaunch (appPath, devicetypeid, log, exit) {
@@ -221,7 +221,7 @@ function listDevices () {
.then(devices => {
events.emit('log', 'Available iOS Devices:');
devices.forEach(device => {
- events.emit('log', '\t' + device);
+ events.emit('log', `\t${device}`);
});
});
}
@@ -231,7 +231,7 @@ function listEmulators () {
.then(emulators => {
events.emit('log', 'Available iOS Simulators:');
emulators.forEach(emulator => {
- events.emit('log', '\t' + emulator);
+ events.emit('log', `\t${emulator}`);
});
});
}
diff --git a/bin/templates/scripts/cordova/lib/spawn.js
b/bin/templates/scripts/cordova/lib/spawn.js
index f1782d0..351452a 100644
--- a/bin/templates/scripts/cordova/lib/spawn.js
+++ b/bin/templates/scripts/cordova/lib/spawn.js
@@ -39,7 +39,7 @@ module.exports = (cmd, args, opt_cwd) => {
child.on('exit', code => {
if (code) {
- d.reject('Error code ' + code + ' for command: ' + cmd + '
with args: ' + args);
+ d.reject(`Error code ${code} for command: ${cmd} with args:
${args}`);
} else {
d.resolve();
}
diff --git a/bin/templates/scripts/cordova/lib/versions.js
b/bin/templates/scripts/cordova/lib/versions.js
index 252a5ba..b414eb9 100755
--- a/bin/templates/scripts/cordova/lib/versions.js
+++ b/bin/templates/scripts/cordova/lib/versions.js
@@ -151,7 +151,7 @@ exports.get_tool_version = toolName => {
case 'ios-sim': return exports.get_ios_sim_version();
case 'ios-deploy': return exports.get_ios_deploy_version();
case 'pod': return exports.get_cocoapods_version();
- default: return Q.reject(toolName + ' is not valid tool name. Valid names
are: \'xcodebuild\', \'ios-sim\', \'ios-deploy\', and \'pod\'');
+ default: return Q.reject(`${toolName} is not valid tool name. Valid names
are: 'xcodebuild', 'ios-sim', 'ios-deploy', and 'pod'`);
}
};
diff --git a/tests/scripts/killsim.js b/tests/scripts/killsim.js
index 643a8de..7ea4ee1 100755
--- a/tests/scripts/killsim.js
+++ b/tests/scripts/killsim.js
@@ -25,17 +25,17 @@ function killSimulator (processName) {
let result;
let return_code = 0;
// check iOS Simulator if running
- const command = 'pgrep -x "' + processName + '" > /dev/null';
+ const command = `pgrep -x "${processName}" > /dev/null`;
return_code = shell.exec(command).code;
// if iOS Simulator is running, kill it
if (return_code === 0) { // found
- shell.echo('iOS Simulator is running as ("' + processName + '"),
we\'re going to kill it.');
- result = shell.exec('killall "' + processName + '"');
+ shell.echo(`iOS Simulator is running as ("${processName}"), we're
going to kill it.`);
+ result = shell.exec(`killall "${processName}"`);
if (result.code !== 0) {
- shell.echo('Failed to kill process: ' + processName);
+ shell.echo(`Failed to kill process: ${processName}`);
} else {
- shell.echo('Process was killed: ' + processName);
+ shell.echo(`Process was killed: ${processName}`);
}
}
}
diff --git a/tests/spec/unit/Api.spec.js b/tests/spec/unit/Api.spec.js
index 99fb42c..275386b 100644
--- a/tests/spec/unit/Api.spec.js
+++ b/tests/spec/unit/Api.spec.js
@@ -305,7 +305,7 @@ describe('Platform Api', () => {
// TODO: a little help with clearly labeling / describing the
tests below? :(
it('should warn if Pods JSON contains name/src but differs in
spec', () => {
podsjson_mock.getLibrary.and.returnValue({
- spec: 'something different from ' + my_pod_json.spec
+ spec: `something different from ${my_pod_json.spec}`
});
spyOn(events, 'emit');
return api.addPlugin(my_plugin)
@@ -340,7 +340,7 @@ describe('Platform Api', () => {
});
it('if two frameworks with the same name are added, should
honour the spec of the first-installed plugin', () => {
podsjson_mock.getLibrary.and.returnValue({
- spec: 'something different from ' + my_pod_json.spec
+ spec: `something different from ${my_pod_json.spec}`
});
return api.addPlugin(my_plugin)
.then(() => {
diff --git a/tests/spec/unit/BridgingHeader.spec.js
b/tests/spec/unit/BridgingHeader.spec.js
index 7e02ce7..348dace 100644
--- a/tests/spec/unit/BridgingHeader.spec.js
+++ b/tests/spec/unit/BridgingHeader.spec.js
@@ -30,7 +30,7 @@ describe('unit tests for BridgingHeader module', () => {
const dummy_path = 'dummy_path';
const dummy_plugin = { id: 'dummy_plugin', header_path:
'dummy_header_path' };
const dummy_plugin2 = { id: 'dummy_plugin2', header_path:
'dummy_header_path2' };
- const headerImportText = header_path => '#import "' + header_path + '"';
+ const headerImportText = header_path => `#import "${header_path}"`;
beforeEach(() => {
existsSyncSpy = spyOn(fs, 'existsSync');
diff --git a/tests/spec/unit/Plugman/common.spec.js
b/tests/spec/unit/Plugman/common.spec.js
index ba746fc..a752ae4 100644
--- a/tests/spec/unit/Plugman/common.spec.js
+++ b/tests/spec/unit/Plugman/common.spec.js
@@ -42,7 +42,7 @@ describe('common handler routines', () => {
it('Test 001 : should throw if source path not found', () => {
shell.rm('-rf', test_dir);
expect(() => { copyFile(test_dir, src, project_dir, dest); })
- .toThrow(new Error('"' + src + '" not found!'));
+ .toThrow(new Error(`"${src}" not found!`));
});
it('Test 002 : should throw if src not in plugin directory', () => {
@@ -50,7 +50,7 @@ describe('common handler routines', () => {
fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
const outside_file = '../non_plugin_file';
expect(() => { copyFile(test_dir, outside_file, project_dir,
dest); })
- .toThrow(new Error('File "' + path.resolve(test_dir,
outside_file) + '" is located outside the plugin directory "' + test_dir +
'"'));
+ .toThrow(new Error(`File "${path.resolve(test_dir,
outside_file)}" is located outside the plugin directory "${test_dir}"`));
shell.rm('-rf', test_dir);
});
@@ -77,7 +77,7 @@ describe('common handler routines', () => {
}
expect(() => { copyFile(test_dir, symlink_file, project_dir,
dest); })
- .toThrow(new Error('File "' + path.resolve(test_dir,
symlink_file) + '" is located outside the plugin directory "' + test_dir +
'"'));
+ .toThrow(new Error(`File "${path.resolve(test_dir,
symlink_file)}" is located outside the plugin directory "${test_dir}"`));
shell.rm('-rf', project_dir);
});
@@ -85,7 +85,7 @@ describe('common handler routines', () => {
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
expect(() => { copyFile(test_dir, srcFile, project_dir,
non_plugin_file); })
- .toThrow(new Error('Destination "' + path.resolve(project_dir,
non_plugin_file) + '" for source file "' + path.resolve(test_dir, srcFile) + '"
is located outside the project'));
+ .toThrow(new Error(`Destination "${path.resolve(project_dir,
non_plugin_file)}" for source file "${path.resolve(test_dir, srcFile)}" is
located outside the project`));
shell.rm('-rf', project_dir);
});
@@ -123,7 +123,7 @@ describe('common handler routines', () => {
it('Test 008 : should throw if target path exists', () => {
shell.mkdir('-p', dest);
expect(() => { copyNewFile(test_dir, src, project_dir, dest); })
- .toThrow(new Error('"' + dest + '" already exists!'));
+ .toThrow(new Error(`"${dest}" already exists!`));
shell.rm('-rf', dest);
});
});
diff --git a/tests/spec/unit/Plugman/pluginHandler.spec.js
b/tests/spec/unit/Plugman/pluginHandler.spec.js
index 2c8e124..d7f227b 100644
--- a/tests/spec/unit/Plugman/pluginHandler.spec.js
+++ b/tests/spec/unit/Plugman/pluginHandler.spec.js
@@ -196,7 +196,7 @@ describe('ios plugin handler', () => {
const resources = copyArray(invalid_resources);
expect(() => {
install(resources[0], faultyPluginInfo, dummyProject);
- }).toThrow(new Error('Cannot find resource file "' +
path.resolve(faultyplugin, 'src/ios/IDontExist.bundle') + '" for plugin ' +
faultyPluginInfo.id + ' in iOS platform'));
+ }).toThrow(new Error(`Cannot find resource file
"${path.resolve(faultyplugin, 'src/ios/IDontExist.bundle')}" for plugin
${faultyPluginInfo.id} in iOS platform`));
});
it('Test 015 : should throw if resource-file target already
exists', () => {
const resources = copyArray(valid_resources);
@@ -205,7 +205,7 @@ describe('ios plugin handler', () => {
fs.writeFileSync(target, 'some bs', 'utf-8');
expect(() => {
install(resources[0], dummyPluginInfo, dummyProject);
- }).toThrow(new Error('File already exists at destination "' +
target + '" for resource file specified by plugin ' + dummyPluginInfo.id + ' in
iOS platform'));
+ }).toThrow(new Error(`File already exists at destination
"${target}" for resource file specified by plugin ${dummyPluginInfo.id} in iOS
platform`));
});
it('Test 016 : should call into xcodeproj\'s addResourceFile', ()
=> {
const resources = copyArray(valid_resources);
@@ -262,7 +262,7 @@ describe('ios plugin handler', () => {
const frameworks = copyArray(invalid_custom_frameworks);
expect(() => {
install(frameworks[0], faultyPluginInfo, dummyProject);
- }).toThrow(new Error('Cannot find framework "' +
path.resolve(faultyplugin, 'src/ios/NonExistantCustomFramework.framework') + '"
for plugin ' + faultyPluginInfo.id + ' in iOS platform'));
+ }).toThrow(new Error(`Cannot find framework
"${path.resolve(faultyplugin, 'src/ios/NonExistantCustomFramework.framework')}"
for plugin ${faultyPluginInfo.id} in iOS platform`));
});
it('Test 021 : should throw if framework target already
exists', () => {
const frameworks = copyArray(valid_custom_frameworks);
@@ -270,7 +270,7 @@ describe('ios plugin handler', () => {
shell.mkdir('-p', target);
expect(() => {
install(frameworks[0], dummyPluginInfo, dummyProject);
- }).toThrow(new Error('Framework "' + target + '" for
plugin ' + dummyPluginInfo.id + ' already exists in iOS platform'));
+ }).toThrow(new Error(`Framework "${target}" for plugin
${dummyPluginInfo.id} already exists in iOS platform`));
});
it('Test 022 : should cp the file to the right target
location', () => {
const frameworks = copyArray(valid_custom_frameworks);
diff --git a/tests/spec/unit/Podfile.spec.js b/tests/spec/unit/Podfile.spec.js
index d5cfdd6..a977740 100644
--- a/tests/spec/unit/Podfile.spec.js
+++ b/tests/spec/unit/Podfile.spec.js
@@ -105,7 +105,7 @@ describe('unit tests for Podfile module', () => {
podfile.write();
// verify by reading it back in a new Podfile
- const newPodfile = new Podfile(fixturePodfile, PROJECT_NAME + '2');
+ const newPodfile = new Podfile(fixturePodfile, `${PROJECT_NAME}2`);
expect(newPodfile.existsSpec('Foo')).toBe(true);
expect(newPodfile.existsSpec('Bar')).toBe(true);
expect(newPodfile.existsSpec('Baz')).toBe(true);
diff --git a/tests/spec/unit/build.spec.js b/tests/spec/unit/build.spec.js
index 51657dc..23897ca 100644
--- a/tests/spec/unit/build.spec.js
+++ b/tests/spec/unit/build.spec.js
@@ -54,8 +54,8 @@ describe('build', () => {
'-archivePath',
'TestProjectName.xcarchive',
'archive',
- 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath,
'build', 'device'),
- 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build',
'sharedpch')
+ `CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build',
'device')}`,
+ `SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build',
'sharedpch')}`
]);
expect(args.length).toEqual(13);
});
@@ -106,8 +106,8 @@ describe('build', () => {
'-archivePath',
'TestProjectName.xcarchive',
'archive',
- 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath,
'build', 'device'),
- 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build',
'sharedpch')
+ `CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build',
'device')}`,
+ `SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build',
'sharedpch')}`
]);
expect(args.length).toEqual(13);
});
@@ -127,8 +127,8 @@ describe('build', () => {
'-destination',
'platform=iOS Simulator,name=iPhone 5s',
'build',
- 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath,
'build', 'emulator'),
- 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build',
'sharedpch')
+ `CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build',
'emulator')}`,
+ `SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build',
'sharedpch')}`
]);
expect(args.length).toEqual(13);
});
@@ -150,8 +150,8 @@ describe('build', () => {
'-archivePath',
'TestProjectName.xcarchive',
'archive',
- 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath,
'build', 'device'),
- 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build',
'sharedpch'),
+ `CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build',
'device')}`,
+ `SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build',
'sharedpch')}`,
'-sdk',
'TestSdkFlag'
]);
@@ -175,8 +175,8 @@ describe('build', () => {
'-destination',
'platform=iOS Simulator,name=iPhone 5s',
'build',
- 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath,
'build', 'emulator'),
- 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build',
'sharedpch'),
+ `CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build',
'emulator')}`,
+ `SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build',
'sharedpch')}`,
'-archivePath',
'TestArchivePathFlag'
]);
@@ -199,8 +199,8 @@ describe('build', () => {
'TestProjectName.xcarchive',
'-allowProvisioningUpdates',
'archive',
- 'CONFIGURATION_BUILD_DIR=' + path.join(testProjectPath,
'build', 'device'),
- 'SHARED_PRECOMPS_DIR=' + path.join(testProjectPath, 'build',
'sharedpch')
+ `CONFIGURATION_BUILD_DIR=${path.join(testProjectPath, 'build',
'device')}`,
+ `SHARED_PRECOMPS_DIR=${path.join(testProjectPath, 'build',
'sharedpch')}`
]);
expect(args.length).toEqual(14);
});
@@ -436,7 +436,7 @@ describe('build', () => {
findXCodeProjectIn(fakePath);
- expect(rejectSpy).toHaveBeenCalledWith('No Xcode project found in
' + fakePath);
+ expect(rejectSpy).toHaveBeenCalledWith(`No Xcode project found in
${fakePath}`);
});
it('should emit finding multiple Xcode projects', () => {
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index f57affc..eaee026 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -49,7 +49,7 @@ describe('prepare', () => {
Api = rewire('../../../bin/templates/scripts/cordova/Api');
shell.mkdir('-p', iosPlatform);
- shell.cp('-rf', iosProjectFixture + '/*', iosPlatform);
+ shell.cp('-rf', `${iosProjectFixture}/*`, iosPlatform);
p = new Api('ios', iosPlatform, new EventEmitter());
});
@@ -246,7 +246,7 @@ describe('prepare', () => {
describe('#platformHasLaunchStoryboardImages', () => {
const platformHasLaunchStoryboardImages =
prepare.__get__('platformHasLaunchStoryboardImages');
const cfgs = ['none', 'legacy-only', 'modern-only',
'modern-and-legacy'].reduce((p, c) => {
- p[c] = new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', c + '.xml'));
+ p[c] = new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', `${c}.xml`));
return p;
}, {});
@@ -267,7 +267,7 @@ describe('prepare', () => {
describe('#platformHasLegacyLaunchImages', () => {
const platformHasLegacyLaunchImages =
prepare.__get__('platformHasLegacyLaunchImages');
const cfgs = ['none', 'legacy-only', 'modern-only',
'modern-and-legacy'].reduce((p, c) => {
- p[c] = new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', c + '.xml'));
+ p[c] = new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', `${c}.xml`));
return p;
}, {});
@@ -292,7 +292,7 @@ describe('prepare', () => {
it('setup', () => {
cfgs = ['none', 'legacy-only', 'modern-only',
'modern-and-legacy'].reduce((p, c) => {
p[c] = {
- config: new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', c + '.xml')),
+ config: new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', `${c}.xml`)),
plist: plist.parse(fs.readFileSync(plistFile, 'utf8'))
};
return p;
@@ -458,7 +458,7 @@ describe('prepare', () => {
it('setup', () => {
cfgs = ['none', 'legacy-only', 'modern-only',
'modern-and-legacy'].reduce((p, c) => {
p[c] = {
- config: new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', c + '.xml')),
+ config: new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', `${c}.xml`)),
plist: plist.parse(fs.readFileSync(plistFile, 'utf8'))
};
return p;
@@ -499,7 +499,7 @@ describe('prepare', () => {
it('setup', () => {
cfgs = ['legacy-only', 'modern-only'].reduce((p, c) => {
p[c] = {
- config: new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', c + '.xml')),
+ config: new ConfigParser(path.join(FIXTURES,
'launch-storyboard-support', 'configs', `${c}.xml`)),
plist: plist.parse(fs.readFileSync(plistFile, 'utf8'))
};
return p;
diff --git a/tests/spec/unit/preparePlatform.spec.js
b/tests/spec/unit/preparePlatform.spec.js
index 6cb64dc..4bf6ac5 100644
--- a/tests/spec/unit/preparePlatform.spec.js
+++ b/tests/spec/unit/preparePlatform.spec.js
@@ -39,7 +39,7 @@ describe('prepare after plugin add', () => {
let api;
beforeEach(() => {
shell.mkdir('-p', iosPlatform);
- shell.cp('-rf', iosProjectFixture + '/*', iosPlatform);
+ shell.cp('-rf', `${iosProjectFixture}/*`, iosPlatform);
api = new Api('ios', iosPlatform, new EventEmitter());
jasmine.addMatchers({
@@ -57,9 +57,9 @@ describe('prepare after plugin add', () => {
}
if (result.pass) {
- result.message = 'Expected ' + actual + ' to be
installed in ' + expected + '.';
+ result.message = `Expected ${actual} to be
installed in ${expected}.`;
} else {
- result.message = 'Expected ' + actual + ' to not
be installed in ' + expected + '.';
+ result.message = `Expected ${actual} to not be
installed in ${expected}.`;
}
return result;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]