Skip to content

Commit

Permalink
rename to info :sad:
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jun 21, 2023
1 parent 5d8c047 commit c7a0e4a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/astro/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type CLICommand =
| 'reload'
| 'sync'
| 'check'
| 'rage'
| 'info'
| 'telemetry';

/** Display --help flag */
Expand All @@ -52,7 +52,7 @@ function printAstroHelp() {
['preview', 'Preview your build locally.'],
['sync', 'Generate content collection types.'],
['telemetry', 'Configure telemetry settings.'],
['rage', 'Emit useful information about Astro current setup. Useful for debugging.'],
['info', 'Emit useful information about Astro current setup. Useful for debugging.'],
],
'Global Flags': [
['--config <path>', 'Specify your config file.'],
Expand All @@ -74,7 +74,7 @@ async function printVersion() {
console.log(` ${colors.bgGreen(colors.black(` astro `))} ${colors.green(`v${ASTRO_VERSION}`)}`);
}

async function printRage({
async function printInfo({
cwd,
flags,
logging,
Expand All @@ -85,7 +85,7 @@ async function printRage({
}) {
const whichPm = await import('which-pm');
const packageManager = await whichPm.default(process.cwd());
let adapter = 'None';
let adapter = "Couldn't determine.";
const integrations = [];

function isIntegration(integration: any): integration is AstroIntegration {
Expand All @@ -105,7 +105,7 @@ async function printRage({
const { userConfig } = await openConfig({
cwd,
flags,
cmd: 'rage',
cmd: 'info',
logging,
});
if (userConfig.adapter?.name) {
Expand All @@ -123,9 +123,9 @@ async function printRage({
printRow('Astro version', `v${ASTRO_VERSION}`);
printRow('Package manager', packageManager.name);
printRow('Adapter', adapter);
let integrationsString = 'None';
if (integrations.length === 0) {
integrations.join(', ');
let integrationsString = "None or couldn't determine.";
if (integrations.length > 0) {
integrationsString = integrations.join(', ');
}
printRow('Integrations', integrationsString);
}
Expand All @@ -144,7 +144,7 @@ function resolveCommand(flags: Arguments): CLICommand {
'preview',
'check',
'docs',
'rage',
'info',
]);
if (supportedCommands.has(cmd)) {
return cmd as CLICommand;
Expand Down Expand Up @@ -188,8 +188,8 @@ async function runCommand(cmd: string, flags: yargs.Arguments) {
case 'version':
await printVersion();
return process.exit(0);
case 'rage': {
await printRage({ cwd: root, flags, logging });
case 'info': {
await printInfo({ cwd: root, flags, logging });
return process.exit(0);
}
}
Expand Down

0 comments on commit c7a0e4a

Please sign in to comment.