@@ -88,7 +88,10 @@ export async function makeAppDir(monoRepoLike: boolean = false) {
8888 await runCommand ( `cd "${ rootDir } " && npm install --save ${ corePath } ${ cliPath } ` ) ;
8989
9090 // Make a fake cordova plugin
91- await makeCordovaPlugin ( appDir ) ;
91+ const cordovaPluginPath = join ( tmpDir , CORDOVA_PLUGIN_ID ) ;
92+ await makeCordovaPlugin ( cordovaPluginPath ) ;
93+
94+ await runCommand ( `cd "${ rootDir } " && npm install --save ${ cordovaPluginPath } ` ) ;
9295
9396 return {
9497 ...appDirObj ,
@@ -180,14 +183,13 @@ Pod::Spec.new do |s|
180183 s.dependency 'CapacitorCordova'
181184end` ;
182185
183- async function makeCordovaPlugin ( appDir : string ) {
184- const cordovaPluginPath = join ( appDir , 'node_modules' , CORDOVA_PLUGIN_ID ) ;
186+ async function makeCordovaPlugin ( cordovaPluginPath : string ) {
185187 const iosPath = join ( cordovaPluginPath , 'src' , 'ios' ) ;
186188 const androidPath = join ( cordovaPluginPath , 'android/com/getcapacitor' ) ;
187189 await mkdirs ( cordovaPluginPath ) ;
188190 await writeFileAsync ( join ( cordovaPluginPath , 'plugin.js' ) , CODOVA_PLUGIN_JS ) ;
189191 await writeFileAsync ( join ( cordovaPluginPath , 'plugin.xml' ) , CORDOVA_PLUGIN_XML ) ;
190- await writeFileAsync ( join ( cordovaPluginPath , 'package.json' ) , JSON . stringify ( CORDOVA_PLUGIN_PACKAGE ) ) ;
192+ await writeFileAsync ( join ( cordovaPluginPath , 'package.json' ) , CORDOVA_PLUGIN_PACKAGE ) ;
191193 await mkdirs ( iosPath ) ;
192194 await mkdirs ( androidPath ) ;
193195 await writeFileAsync ( join ( iosPath , 'CoolPlugin.m' ) , '' ) ;
0 commit comments