Skip to content

Commit

Permalink
fix(cli): Run sync before updating gradle (#7497)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Jun 10, 2024
1 parent b32b5b1 commit f27786e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions cli/src/tasks/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { logger, logPrompt, logSuccess } from '../log';
import { getPlugins } from '../plugin';
import { deleteFolderRecursive } from '../util/fs';
import { resolveNode } from '../util/node';
import { runCommand, getCommandOutput } from '../util/subprocess';
import { runCommand } from '../util/subprocess';
import { extractTemplate } from '../util/template';

// eslint-disable-next-line prefer-const
Expand Down Expand Up @@ -184,6 +184,14 @@ export async function migrateCommand(
);
}

if (!installFailed) {
await runTask(`Running cap sync.`, () => {
return runCommand('npx', ['cap', 'sync']);
});
} else {
logger.warn('Skipped Running cap sync.');
}

if (
allDependencies['@capacitor/android'] &&
existsSync(config.android.platformDirAbs)
Expand Down Expand Up @@ -351,15 +359,6 @@ export async function migrateCommand(
}
}

if (!installFailed) {
// Run Cap Sync
await runTask(`Running cap sync.`, () => {
return getCommandOutput('npx', ['cap', 'sync']);
});
} else {
logger.warn('Skipped Running cap sync.');
}

// Write all breaking changes
await runTask(`Writing breaking changes.`, () => {
return writeBreakingChanges();
Expand Down

0 comments on commit f27786e

Please sign in to comment.