Skip to content

Commit

Permalink
fix(cordova): load config.xml after serve/build hooks
Browse files Browse the repository at this point in the history
fixes #4579
  • Loading branch information
imhoffd committed Oct 12, 2020
1 parent e243357 commit 9867ada
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@ionic/cli/src/commands/cordova/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ Just like with ${input('ionic cordova build')}, you can pass additional options

protected async runServeDeploy(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void> {
const { loadCordovaConfig } = await import('../../lib/integrations/cordova/config');
const conf = await loadCordovaConfig(this.integration);
const metadata = await this.getMetadata();

if (!this.project) {
Expand Down Expand Up @@ -283,6 +282,8 @@ Just like with ${input('ionic cordova build')}, you can pass additional options
serverUrl = `${details.protocol || 'http'}://${details.externalAddress}:${details.port}`;
}

const conf = await loadCordovaConfig(this.integration);

onBeforeExit(async () => {
conf.resetContentSrc();
await conf.save();
Expand Down Expand Up @@ -313,7 +314,6 @@ Just like with ${input('ionic cordova build')}, you can pass additional options

protected async runBuildDeploy(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void> {
const { loadCordovaConfig } = await import('../../lib/integrations/cordova/config');
const conf = await loadCordovaConfig(this.integration);
const metadata = await this.getMetadata();

if (!this.project) {
Expand All @@ -335,6 +335,7 @@ Just like with ${input('ionic cordova build')}, you can pass additional options
}

if (options['native-run']) {
const conf = await loadCordovaConfig(this.integration);
const [ platform ] = inputs;

await this.runCordova(filterArgumentsForCordova({ ...metadata, name: 'build' }, options), { stdio: 'inherit' });
Expand Down

0 comments on commit 9867ada

Please sign in to comment.