Skip to content

Commit 86abfa5

Browse files
ascorbicastrobot-houston
authored andcommitted
[ci] format
1 parent 48ca399 commit 86abfa5

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

packages/astro/src/cli/info/index.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,36 +119,36 @@ export function readFromClipboard() {
119119
let args: Array<string> = [];
120120

121121
if (system === 'darwin') {
122-
command = 'pbpaste';
122+
command = 'pbpaste';
123123
} else if (system === 'win32') {
124-
command = 'powershell';
125-
args = ['-command', 'Get-Clipboard'];
124+
command = 'powershell';
125+
args = ['-command', 'Get-Clipboard'];
126126
} else {
127-
const unixCommands: Array<[string, Array<string>]> = [
128-
['xclip', ['-sel', 'clipboard', '-o']],
129-
['wl-paste', []],
130-
];
131-
for (const [unixCommand, unixArgs] of unixCommands) {
132-
try {
133-
const output = spawnSync('which', [unixCommand], { encoding: 'utf8' });
134-
if (output.stdout.trim()) {
135-
command = unixCommand;
136-
args = unixArgs;
137-
break;
138-
}
139-
} catch {
140-
continue;
141-
}
127+
const unixCommands: Array<[string, Array<string>]> = [
128+
['xclip', ['-sel', 'clipboard', '-o']],
129+
['wl-paste', []],
130+
];
131+
for (const [unixCommand, unixArgs] of unixCommands) {
132+
try {
133+
const output = spawnSync('which', [unixCommand], { encoding: 'utf8' });
134+
if (output.stdout.trim()) {
135+
command = unixCommand;
136+
args = unixArgs;
137+
break;
138+
}
139+
} catch {
140+
continue;
142141
}
142+
}
143143
}
144144

145145
if (!command) {
146-
throw new Error('Clipboard read command not found!');
146+
throw new Error('Clipboard read command not found!');
147147
}
148148

149149
const result = spawnSync(command, args, { encoding: 'utf8' });
150150
if (result.error) {
151-
throw result.error;
151+
throw result.error;
152152
}
153153
return result.stdout.trim();
154154
}

packages/astro/test/cli.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import assert from 'node:assert/strict';
22
import { promises as fs, readFileSync } from 'node:fs';
33
import { isIPv4 } from 'node:net';
44
import { join } from 'node:path';
5+
import { platform } from 'node:process';
56
import { Writable } from 'node:stream';
67
import { describe, it } from 'node:test';
78
import { fileURLToPath } from 'node:url';
89
import { stripVTControlCharacters } from 'node:util';
9-
import { cli, cliServerLogSetup, loadFixture, parseCliDevStart } from './test-utils.js';
1010
import { readFromClipboard } from '../dist/cli/info/index.js';
11-
import { platform } from 'node:process';
11+
import { cli, cliServerLogSetup, loadFixture, parseCliDevStart } from './test-utils.js';
1212

1313
describe('astro cli', () => {
1414
const cliServerLogSetupWithFixture = (flags, cmd) => {
@@ -88,14 +88,16 @@ describe('astro cli', () => {
8888
assert.equal(proc.exitCode, 0);
8989

9090
// On Linux we only check if we have Wayland or x11. In Codespaces it falsely reports that it does have x11
91-
if(platform === 'linux' && ((!process.env.WAYLAND_DISPLAY && !process.env.DISPLAY) || process.env.CODESPACES)) {
91+
if (
92+
platform === 'linux' &&
93+
((!process.env.WAYLAND_DISPLAY && !process.env.DISPLAY) || process.env.CODESPACES)
94+
) {
9295
assert.ok(proc.stdout.includes('Please manually copy the text above'));
9396
} else {
9497
assert.ok(proc.stdout.includes('Copied to clipboard!'));
9598
const clipboardContent = await readFromClipboard();
9699
assert.ok(clipboardContent.includes(`v${pkgVersion}`));
97100
}
98-
99101
});
100102

101103
it(

0 commit comments

Comments
 (0)