@@ -7,6 +7,7 @@ import * as helpers from "../common/helpers";
7
7
let clui = require ( "clui" ) ;
8
8
9
9
class DoctorService implements IDoctorService {
10
+ private static PROJECT_NAME_PLACEHOLDER = "__PROJECT_NAME__" ;
10
11
private static MIN_SUPPORTED_POD_VERSION = "0.38.2" ;
11
12
private static DarwinSetupScriptLocation = path . join ( __dirname , ".." , ".." , "setup" , "mac-startup-shell-script.sh" ) ;
12
13
private static DarwinSetupDocsLink = "https://docs.nativescript.org/start/ns-setup-os-x" ;
@@ -17,6 +18,7 @@ class DoctorService implements IDoctorService {
17
18
18
19
constructor ( private $analyticsService : IAnalyticsService ,
19
20
private $androidToolsInfo : IAndroidToolsInfo ,
21
+ private $cocoapodsService : ICocoaPodsService ,
20
22
private $hostInfo : IHostInfo ,
21
23
private $logger : ILogger ,
22
24
private $progressIndicator : IProgressIndicator ,
@@ -187,7 +189,7 @@ class DoctorService implements IDoctorService {
187
189
let iosDir = path . join ( projDir , "node_modules" , "tns-ios" , "framework" ) ;
188
190
this . $fs . writeFile (
189
191
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 ( ) } `
191
193
) . wait ( ) ;
192
194
193
195
spinner . message ( "Verifying CocoaPods. This may take some time, please be patient." ) ;
@@ -207,7 +209,7 @@ class DoctorService implements IDoctorService {
207
209
return true ;
208
210
}
209
211
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 ( ) ) ;
211
213
} catch ( err ) {
212
214
this . $logger . trace ( `verifyCocoaPods error: ${ err } ` ) ;
213
215
return true ;
0 commit comments