File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
com.onesignal.unity.ios/Editor Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -279,22 +279,27 @@ private void ExtensionAddPodsToTarget() {
279
279
280
280
podfile += $ "target '{ ServiceExtensionTargetName } ' do\n pod 'OneSignalXCFramework', '~> 3.8.1'\n end\n ";
281
281
File . WriteAllText ( podfilePath , podfile ) ;
282
-
283
- // todo - detect if cocoapods is installed
284
-
282
+
283
+ var installResult = _runShellCommand ( $ "-c \" pod install --project-directory={ _outputPath } \" ") ;
284
+ if ( ! installResult . Contains ( "Installing OneSignalXCFramework" ) )
285
+ Debug . LogError ( $ "Could not detect install with Cocoapods. { ServiceExtensionFilename } may have errors.") ;
286
+ }
287
+
288
+ private static string _runShellCommand ( string command ) {
285
289
var process = new Process {
286
290
StartInfo = new ProcessStartInfo {
287
- FileName = "/bin/bash " ,
288
- Arguments = $ "-c \" pod install --project-directory= { _outputPath } \" " ,
291
+ FileName = "/bin/sh " ,
292
+ Arguments = command ,
289
293
RedirectStandardOutput = true ,
290
294
UseShellExecute = false ,
291
295
CreateNoWindow = true ,
292
296
}
293
297
} ;
294
298
295
299
process . Start ( ) ;
296
- Debug . Log ( process . StandardOutput . ReadToEnd ( ) ) ;
300
+ var ret = process . StandardOutput . ReadToEnd ( ) ;
297
301
process . WaitForExit ( ) ;
302
+ return ret ;
298
303
}
299
304
}
300
305
}
You can’t perform that action at this time.
0 commit comments