Remove devDependency flag from astro add (#4666)

* remove dev dependency flag

* remove redundant space if no flags
This commit is contained in:
Dan Jutan 2022-09-08 18:03:09 -04:00 committed by GitHub
parent 919df13b91
commit fcb9a05c31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -551,11 +551,11 @@ async function getInstallIntegrationsCommand({
switch (pm.name) { switch (pm.name) {
case 'npm': case 'npm':
return { pm: 'npm', command: 'install', flags: ['--save-dev'], dependencies }; return { pm: 'npm', command: 'install', flags: [], dependencies };
case 'yarn': case 'yarn':
return { pm: 'yarn', command: 'add', flags: ['--dev'], dependencies }; return { pm: 'yarn', command: 'add', flags: [], dependencies };
case 'pnpm': case 'pnpm':
return { pm: 'pnpm', command: 'install', flags: ['--save-dev'], dependencies }; return { pm: 'pnpm', command: 'install', flags: [], dependencies };
default: default:
return null; return null;
} }
@ -579,7 +579,7 @@ async function tryToInstallIntegrations({
} else { } else {
const coloredOutput = `${bold(installCommand.pm)} ${ const coloredOutput = `${bold(installCommand.pm)} ${
installCommand.command installCommand.command
} ${installCommand.flags.join(' ')} ${cyan(installCommand.dependencies.join(' '))}`; }${['', ...installCommand.flags].join(' ')} ${cyan(installCommand.dependencies.join(' '))}`;
const message = `\n${boxen(coloredOutput, { const message = `\n${boxen(coloredOutput, {
margin: 0.5, margin: 0.5,
padding: 0.5, padding: 0.5,