From bb9f9dbc6e7fd5acf0750153baebf047334d6924 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Wed, 6 Apr 2022 17:19:49 +0000 Subject: [PATCH] [ci] format --- src/cli/index.ts | 17 +++++++++++++---- src/cli/open.ts | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/cli/index.ts b/src/cli/index.ts index 5d6612b43404..bb0307667230 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -18,7 +18,16 @@ import { printHelp, formatErrorMessage, formatConfigErrorMessage } from '../core import { createSafeError } from '../core/util.js'; type Arguments = yargs.Arguments; -type CLICommand = 'help' | 'version' | 'add' | 'docs' | 'dev' | 'build' | 'preview' | 'reload' | 'check'; +type CLICommand = + | 'help' + | 'version' + | 'add' + | 'docs' + | 'dev' + | 'build' + | 'preview' + | 'reload' + | 'check'; /** Display --help flag */ function printAstroHelp() { @@ -27,7 +36,7 @@ function printAstroHelp() { headline: 'Futuristic web development tool.', commands: [ ['add', 'Add an integration to your configuration.'], - ['docs', 'Launch Astro\'s Doc site directly 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.'], @@ -148,9 +157,9 @@ export async function cli(args: string[]) { case 'docs': { try { - return await openInBrowser('https://docs.astro.build/') + return await openInBrowser('https://docs.astro.build/'); } catch (err) { - return throwAndExit(err) + return throwAndExit(err); } } diff --git a/src/cli/open.ts b/src/cli/open.ts index ad803513e347..1227ebff4ab3 100644 --- a/src/cli/open.ts +++ b/src/cli/open.ts @@ -5,7 +5,7 @@ import { execa } from 'execa'; * Credit: Azhar22 * @see https://github.com/azhar22k/ourl/blob/master/index.js */ -const getPlatformSpecificCommand = (): [string]|[string, string[]] => { +const getPlatformSpecificCommand = (): [string] | [string, string[]] => { const isGitPod = Boolean(process.env.GITPOD_REPO_ROOT); const platform = isGitPod ? 'gitpod' : process.platform; @@ -29,4 +29,4 @@ const getPlatformSpecificCommand = (): [string]|[string, string[]] => { export async function openInBrowser(url: string): Promise { const [command, args = []] = getPlatformSpecificCommand(); return execa(command, [...args, encodeURI(url)]); -}; +}