[ci] format

This commit is contained in:
natemoo-re 2022-04-06 17:19:49 +00:00 committed by GitHub Actions
parent d0777ad3af
commit debdf11b19
2 changed files with 15 additions and 6 deletions

View file

@ -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);
}
}

View file

@ -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<ExecaChildProcess> {
const [command, args = []] = getPlatformSpecificCommand();
return execa(command, [...args, encodeURI(url)]);
};
}