@@ -24,7 +24,7 @@ const shell = require('shelljs');
2424const util = require ( 'util' ) ;
2525const versions = require ( './versions' ) ;
2626
27- const SUPPORTED_OS_PLATFORMS = [ 'darwin' ] ;
27+ const SUPPORTED_OS_PLATFORMS = [ 'darwin' ] ;
2828
2929const XCODEBUILD_MIN_VERSION = '9.0.0' ;
3030const XCODEBUILD_NOT_FOUND_MESSAGE =
@@ -63,9 +63,9 @@ module.exports.check_ios_deploy = function () {
6363
6464module . exports . check_os = function ( ) {
6565 // Build iOS apps available for OSX platform only, so we reject on others platforms
66- return os_platform_is_supported ( ) ?
67- Q . resolve ( process . platform ) :
68- Q . reject ( 'Cordova tooling for iOS requires Apple macOS' ) ;
66+ return os_platform_is_supported ( )
67+ ? Q . resolve ( process . platform )
68+ : Q . reject ( 'Cordova tooling for iOS requires Apple macOS' ) ;
6969} ;
7070
7171function os_platform_is_supported ( ) {
@@ -78,8 +78,8 @@ function check_cocoapod_tool (toolChecker) {
7878 return toolChecker ( 'pod' , COCOAPODS_MIN_VERSION , COCOAPODS_NOT_FOUND_MESSAGE , 'CocoaPods' ) ;
7979 } else {
8080 return Q . resolve ( {
81- ' ignore' : true ,
82- ' ignoreMessage' : `CocoaPods check and installation ignored on ${ process . platform } `
81+ ignore : true ,
82+ ignoreMessage : `CocoaPods check and installation ignored on ${ process . platform } `
8383 } ) ;
8484 }
8585}
@@ -92,10 +92,10 @@ module.exports.check_cocoapods_repo_size = function () {
9292 return check_cocoapod_tool ( )
9393 . then ( function ( toolOptions ) {
9494 // check size of ~/.cocoapods repo
95- let commandString = util . format ( 'du -sh %s/.cocoapods' , process . env . HOME ) ;
96- let command = shell . exec ( commandString , { silent : true } ) ;
95+ const commandString = util . format ( 'du -sh %s/.cocoapods' , process . env . HOME ) ;
96+ const command = shell . exec ( commandString , { silent : true } ) ;
9797 // command.output is e.g "750M path/to/.cocoapods", we just scan the number
98- let size = toolOptions . ignore ? 0 : parseFloat ( command . output ) ;
98+ const size = toolOptions . ignore ? 0 : parseFloat ( command . output ) ;
9999
100100 if ( toolOptions . ignore || command . code === 0 ) { // success, parse output
101101 return Q . resolve ( size , toolOptions ) ;
@@ -128,8 +128,8 @@ module.exports.check_cocoapods = function (toolChecker) {
128128 return toolOptions ;
129129 }
130130
131- let code = shell . exec ( 'pod repo | grep -e "^0 repos"' , { silent : true } ) . code ;
132- let repoIsSynced = ( code !== 0 ) ;
131+ const code = shell . exec ( 'pod repo | grep -e "^0 repos"' , { silent : true } ) . code ;
132+ const repoIsSynced = ( code !== 0 ) ;
133133
134134 if ( repoIsSynced ) {
135135 // return check_cocoapods_repo_size();
@@ -153,17 +153,17 @@ function checkTool (tool, minVersion, message, toolFriendlyName) {
153153 toolFriendlyName = toolFriendlyName || tool ;
154154
155155 // Check whether tool command is available at all
156- let tool_command = shell . which ( tool ) ;
156+ const tool_command = shell . which ( tool ) ;
157157 if ( ! tool_command ) {
158158 return Q . reject ( toolFriendlyName + ' was not found. ' + ( message || '' ) ) ;
159159 }
160160
161161 // check if tool version is greater than specified one
162162 return versions . get_tool_version ( tool ) . then ( function ( version ) {
163163 version = version . trim ( ) ;
164- return versions . compareVersions ( version , minVersion ) >= 0 ?
165- Q . resolve ( { ' version' : version } ) :
166- Q . reject ( 'Cordova needs ' + toolFriendlyName + ' version ' + minVersion +
164+ return versions . compareVersions ( version , minVersion ) >= 0
165+ ? Q . resolve ( { version : version } )
166+ : Q . reject ( 'Cordova needs ' + toolFriendlyName + ' version ' + minVersion +
167167 ' or greater, you have version ' + version + '. ' + ( message || '' ) ) ;
168168 } ) ;
169169}
@@ -175,7 +175,7 @@ function checkTool (tool, minVersion, message, toolFriendlyName) {
175175 * @param {Boolean } isFatal Marks the requirement as fatal. If such requirement will fail
176176 * next requirements' checks will be skipped.
177177 */
178- let Requirement = function ( id , name , isFatal ) {
178+ const Requirement = function ( id , name , isFatal ) {
179179 this . id = id ;
180180 this . name = name ;
181181 this . installed = false ;
@@ -190,18 +190,17 @@ let Requirement = function (id, name, isFatal) {
190190 * @return Promise<Requirement[]> Array of requirements. Due to implementation, promise is always fulfilled.
191191 */
192192module . exports . check_all = function ( ) {
193-
194193 const requirements = [
195194 new Requirement ( 'os' , 'Apple macOS' , true ) ,
196195 new Requirement ( 'xcode' , 'Xcode' ) ,
197196 new Requirement ( 'ios-deploy' , 'ios-deploy' ) ,
198197 new Requirement ( 'CocoaPods' , 'CocoaPods' )
199198 ] ;
200199
201- let result = [ ] ;
200+ const result = [ ] ;
202201 let fatalIsHit = false ;
203202
204- let checkFns = [
203+ const checkFns = [
205204 module . exports . check_os ,
206205 module . exports . check_xcodebuild ,
207206 module . exports . check_ios_deploy ,
@@ -215,7 +214,7 @@ module.exports.check_all = function () {
215214 // we don't need to check others
216215 if ( fatalIsHit ) return Q ( ) ;
217216
218- let requirement = requirements [ idx ] ;
217+ const requirement = requirements [ idx ] ;
219218 return checkFn ( )
220219 . then ( function ( version ) {
221220 requirement . installed = true ;
0 commit comments