Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): Support bun when running cap migrate #7386

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions cli/src/tasks/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export async function migrateCommand(
};

const monorepoWarning =
'Please note this tool is not intended for use in a mono-repo enviroment, please check out the Ionic vscode extension for this functionality.';
'Please note this tool is not intended for use in a mono-repo environment, please check out the Ionic vscode extension for this functionality.';

logger.info(monorepoWarning);

Expand All @@ -119,7 +119,7 @@ export async function migrateCommand(
const { depInstallConfirm } = noprompt
? { depInstallConfirm: 'y' }
: await logPrompt(
`Would you like the migrator to run npm, yarn, or pnpm install to install the latest versions of capacitor packages? (Those using other package managers should answer N)`,
`Would you like the migrator to run npm, yarn, bun, or pnpm install to install the latest versions of capacitor packages? (Those using other package managers should answer N)`,
dtarnawsky marked this conversation as resolved.
Show resolved Hide resolved
{
type: 'text',
name: 'depInstallConfirm',
Expand All @@ -144,6 +144,7 @@ export async function migrateCommand(
{ title: 'NPM', value: 'npm' },
{ title: 'Yarn', value: 'yarn' },
{ title: 'PNPM', value: 'pnpm' },
{ title: 'Bun', value: 'bun' },
],
initial: 0,
});
Expand Down Expand Up @@ -354,7 +355,8 @@ export async function migrateCommand(
if (!installFailed) {
// Run Cap Sync
await runTask(`Running cap sync.`, () => {
return getCommandOutput('npx', ['cap', 'sync']);
const runCommand = installerType == 'bun' ? 'bunx' : 'npx';
return getCommandOutput(runCommand, ['cap', 'sync']);
dtarnawsky marked this conversation as resolved.
Show resolved Hide resolved
});
} else {
logger.warn('Skipped Running cap sync.');
Expand Down