Skip to content

Commit

Permalink
Moved docs cmd to supportedCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
aFuzzyBear authored and Nate Moore committed Apr 6, 2022
1 parent 9f75b5a commit e1df3bd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/astro/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function printAstroHelp() {
headline: 'Futuristic web development tool.',
commands: [
['add', 'Add an integration to your configuration.'],
['docs', 'Launch Astro\'s Doc site from the terminal. '],
['docs', 'Launch Astro\'s Doc site directly from the terminal. '],
['dev', 'Run Astro in development mode.'],
['build', 'Build a pre-compiled production-ready site.'],
['preview', 'Preview your build locally before deploying.'],
Expand Down Expand Up @@ -60,12 +60,10 @@ async function printVersion() {
function resolveCommand(flags: Arguments): CLICommand {
const cmd = flags._[2] as string;
if (cmd === 'add') return 'add';
if (cmd === 'docs') return 'docs';

if (flags.version) return 'version';
else if (flags.help) return 'help';

const supportedCommands = new Set(['dev', 'build', 'preview', 'check']);
const supportedCommands = new Set(['dev', 'build', 'preview', 'check', 'docs']);
if (supportedCommands.has(cmd)) {
return cmd as CLICommand;
}
Expand Down Expand Up @@ -149,7 +147,7 @@ export async function cli(args: string[]) {
}
case 'docs':{
try{
await browser('https://docs.astro.build/')
await browser('https://docs.astro.build/')//Launches System Browser
process.exit(0)
}catch(err){
throwAndExit(err)
Expand Down

0 comments on commit e1df3bd

Please sign in to comment.