@@ -88,7 +88,10 @@ export async function makeAppDir(monoRepoLike: boolean = false) {
88
88
await runCommand ( `cd "${ rootDir } " && npm install --save ${ corePath } ${ cliPath } ` ) ;
89
89
90
90
// 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 } ` ) ;
92
95
93
96
return {
94
97
...appDirObj ,
@@ -180,14 +183,13 @@ Pod::Spec.new do |s|
180
183
s.dependency 'CapacitorCordova'
181
184
end` ;
182
185
183
- async function makeCordovaPlugin ( appDir : string ) {
184
- const cordovaPluginPath = join ( appDir , 'node_modules' , CORDOVA_PLUGIN_ID ) ;
186
+ async function makeCordovaPlugin ( cordovaPluginPath : string ) {
185
187
const iosPath = join ( cordovaPluginPath , 'src' , 'ios' ) ;
186
188
const androidPath = join ( cordovaPluginPath , 'android/com/getcapacitor' ) ;
187
189
await mkdirs ( cordovaPluginPath ) ;
188
190
await writeFileAsync ( join ( cordovaPluginPath , 'plugin.js' ) , CODOVA_PLUGIN_JS ) ;
189
191
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 ) ;
191
193
await mkdirs ( iosPath ) ;
192
194
await mkdirs ( androidPath ) ;
193
195
await writeFileAsync ( join ( iosPath , 'CoolPlugin.m' ) , '' ) ;
0 commit comments