Skip to content

Commit ab4e700

Browse files
authored
fix(cli): Don't migrate Podfile on SPM projects (#7939)
1 parent eb1a10f commit ab4e700

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cli/src/tasks/migrate.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { logger, logPrompt, logSuccess } from '../log';
1212
import { getPlugins } from '../plugin';
1313
import { deleteFolderRecursive } from '../util/fs';
1414
import { resolveNode } from '../util/node';
15+
import { checkPackageManager } from '../util/spm';
1516
import { runCommand } from '../util/subprocess';
1617
import { extractTemplate } from '../util/template';
1718

@@ -157,10 +158,13 @@ export async function migrateCommand(config: Config, noprompt: boolean, packagem
157158
'14.0',
158159
);
159160
});
160-
// Update Podfile to 14.0
161-
await runTask(`Migrating Podfile to 14.0.`, () => {
162-
return updateFile(config, join(config.ios.nativeProjectDirAbs, 'Podfile'), `platform :ios, '`, `'`, '14.0');
163-
});
161+
162+
if ((await checkPackageManager(config)) === 'Cocoapods') {
163+
// Update Podfile to 14.0
164+
await runTask(`Migrating Podfile to 14.0.`, () => {
165+
return updateFile(config, join(config.ios.nativeProjectDirAbs, 'Podfile'), `platform :ios, '`, `'`, '14.0');
166+
});
167+
}
164168
}
165169

166170
if (!installFailed) {

0 commit comments

Comments
 (0)