1- import { copy , remove , pathExists , readFile , realpath , writeFile } from 'fs-extra' ;
1+ import { copy , remove , pathExists , readFile , writeFile } from 'fs-extra' ;
22import { basename , dirname , join , relative } from 'path' ;
33
44import c from '../colors' ;
@@ -120,7 +120,7 @@ export async function installCocoaPodsPlugins(config: Config, plugins: Plugin[],
120120
121121async function updatePodfile ( config : Config , plugins : Plugin [ ] , deployment : boolean ) : Promise < void > {
122122 const dependenciesContent = await generatePodFile ( config , plugins ) ;
123- const relativeCapacitoriOSPath = await getRelativeCapacitoriOSPath ( config ) ;
123+ const relativeCapacitoriOSPath = getRelativeCapacitoriOSPath ( config ) ;
124124 const podfilePath = join ( config . ios . nativeProjectDirAbs , 'Podfile' ) ;
125125 let podfileContent = await readFile ( podfilePath , { encoding : 'utf-8' } ) ;
126126 podfileContent = podfileContent . replace ( / ( d e f c a p a c i t o r _ p o d s ) [ \s \S ] + ?( \n e n d ) / , `$1${ dependenciesContent } $2` ) ;
@@ -157,7 +157,7 @@ async function updatePodfile(config: Config, plugins: Plugin[], deployment: bool
157157 }
158158}
159159
160- async function getRelativeCapacitoriOSPath ( config : Config ) {
160+ function getRelativeCapacitoriOSPath ( config : Config ) {
161161 const capacitoriOSPath = resolveNode ( config . app . rootDir , '@capacitor/ios' , 'package.json' ) ;
162162
163163 if ( ! capacitoriOSPath ) {
@@ -167,24 +167,19 @@ async function getRelativeCapacitoriOSPath(config: Config) {
167167 ) ;
168168 }
169169
170- return convertToUnixPath ( relative ( config . ios . nativeProjectDirAbs , await realpath ( dirname ( capacitoriOSPath ) ) ) ) ;
170+ return convertToUnixPath ( relative ( config . ios . nativeProjectDirAbs , dirname ( capacitoriOSPath ) ) ) ;
171171}
172172
173173async function generatePodFile ( config : Config , plugins : Plugin [ ] ) : Promise < string > {
174- const relativeCapacitoriOSPath = await getRelativeCapacitoriOSPath ( config ) ;
175-
176- const capacitorPlugins = plugins . filter ( ( p ) => getPluginType ( p , platform ) === PluginType . Core ) ;
177- const pods = await Promise . all (
178- capacitorPlugins . map ( async ( p ) => {
179- if ( ! p . ios ) {
180- return '' ;
181- }
182-
183- return ` pod '${ p . ios . name } ', :path => '${ convertToUnixPath (
184- relative ( config . ios . nativeProjectDirAbs , await realpath ( p . rootPath ) ) ,
185- ) } '\n`;
186- } ) ,
187- ) ;
174+ const relativeCapacitoriOSPath = getRelativeCapacitoriOSPath ( config ) ;
175+
176+ const pods = plugins
177+ . filter ( ( p ) => getPluginType ( p , platform ) === PluginType . Core && p . ios )
178+ . map ( ( p ) =>
179+ ` pod '${ p . ios . name } ', :path => '${ convertToUnixPath (
180+ relative ( config . ios . nativeProjectDirAbs , p . rootPath ) ,
181+ ) } '\n`
182+ ) ;
188183 const cordovaPlugins = plugins . filter ( ( p ) => getPluginType ( p , platform ) === PluginType . Cordova ) ;
189184 cordovaPlugins . map ( async ( p ) => {
190185 const podspecs = getPlatformElement ( p , platform , 'podspec' ) ;
0 commit comments