Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and actions-user committed Apr 6, 2022
1 parent 0aafba4 commit bb9f9db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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.'],
Expand Down Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cli/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -29,4 +29,4 @@ const getPlatformSpecificCommand = (): [string]|[string, string[]] => {
export async function openInBrowser(url: string): Promise<ExecaChildProcess> {
const [command, args = []] = getPlatformSpecificCommand();
return execa(command, [...args, encodeURI(url)]);
};
}

0 comments on commit bb9f9db

Please sign in to comment.