CB-12895 : fixed eslint errors

This commit is contained in:
Audrey So
2017-06-13 11:42:20 -07:00
parent e36158a0da
commit d83d49d83b
40 changed files with 3176 additions and 3325 deletions
+8 -8
View File
@@ -4,13 +4,13 @@
* @param {String} root Root folder of the project
*/
/*jshint esnext: false */
/* jshint esnext: false */
var path = require('path');
var fs = require('fs');
var CordovaError = require('cordova-common').CordovaError;
module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) {
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res', 'project.properties', 'platform_www'];
var androidStudioFiles = ['app', 'gradle', 'app/src/main/res'];
@@ -18,21 +18,21 @@ module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
var isEclipse = false;
var isAS = true;
if(!fs.existsSync(root)) {
if (!fs.existsSync(root)) {
throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
}
// if any of the following exists, then we are not an ASProj
eclipseFiles.forEach(function(file) {
if(fs.existsSync(path.join(root, file))) {
eclipseFiles.forEach(function (file) {
if (fs.existsSync(path.join(root, file))) {
isEclipse = true;
}
});
// if it is NOT an eclipse project, check that all required files exist
if(!isEclipse) {
androidStudioFiles.forEach(function(file){
if(!fs.existsSync(path.join(root, file))) {
if (!isEclipse) {
androidStudioFiles.forEach(function (file) {
if (!fs.existsSync(path.join(root, file))) {
console.log('missing file :: ' + file);
isAS = false;
}