0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

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