@@ -7,6 +7,7 @@ import * as helpers from "../common/helpers";
77let clui = require ( "clui" ) ;
88
99class DoctorService implements IDoctorService {
10+ private static PROJECT_NAME_PLACEHOLDER = "__PROJECT_NAME__" ;
1011 private static MIN_SUPPORTED_POD_VERSION = "0.38.2" ;
1112 private static DarwinSetupScriptLocation = path . join ( __dirname , ".." , ".." , "setup" , "mac-startup-shell-script.sh" ) ;
1213 private static DarwinSetupDocsLink = "https://docs.nativescript.org/start/ns-setup-os-x" ;
@@ -17,6 +18,7 @@ class DoctorService implements IDoctorService {
1718
1819 constructor ( private $analyticsService : IAnalyticsService ,
1920 private $androidToolsInfo : IAndroidToolsInfo ,
21+ private $cocoapodsService : ICocoaPodsService ,
2022 private $hostInfo : IHostInfo ,
2123 private $logger : ILogger ,
2224 private $progressIndicator : IProgressIndicator ,
@@ -187,7 +189,7 @@ class DoctorService implements IDoctorService {
187189 let iosDir = path . join ( projDir , "node_modules" , "tns-ios" , "framework" ) ;
188190 this . $fs . writeFile (
189191 path . join ( iosDir , "Podfile" ) ,
190- " pod 'AFNetworking', '~> 1.0'\n"
192+ ` ${ this . $cocoapodsService . getPodfileHeader ( DoctorService . PROJECT_NAME_PLACEHOLDER ) } pod 'AFNetworking', '~> 1.0'${ this . $cocoapodsService . getPodfileFooter ( ) } `
191193 ) . wait ( ) ;
192194
193195 spinner . message ( "Verifying CocoaPods. This may take some time, please be patient." ) ;
@@ -207,7 +209,7 @@ class DoctorService implements IDoctorService {
207209 return true ;
208210 }
209211
210- return ! ( this . $fs . exists ( path . join ( iosDir , "__PROJECT_NAME__. xcworkspace" ) ) . wait ( ) ) ;
212+ return ! ( this . $fs . exists ( path . join ( iosDir , ` ${ DoctorService . PROJECT_NAME_PLACEHOLDER } . xcworkspace` ) ) . wait ( ) ) ;
211213 } catch ( err ) {
212214 this . $logger . trace ( `verifyCocoaPods error: ${ err } ` ) ;
213215 return true ;
0 commit comments