Skip to content

Commit 3a7b338

Browse files
committed
.
1 parent 83ad4b1 commit 3a7b338

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

packages/proxy-agent/test/test.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,13 @@ describe('ProxyAgent', () => {
329329
process.env.WSS_PROXY = httpProxyServerUrl.href;
330330
const agent = new ProxyAgent();
331331

332-
const ws = new WebSocket(httpsServerUrl.href.replace('https', 'wss'), {
333-
agent,
334-
rejectUnauthorized: false
335-
});
332+
const ws = new WebSocket(
333+
httpsServerUrl.href.replace('https', 'wss'),
334+
{
335+
agent,
336+
rejectUnauthorized: false,
337+
}
338+
);
336339
const [message] = await once(ws, 'message');
337340
expect(connectionCount).toEqual(1);
338341
expect(requestCount).toEqual(0);

scripts/tags.mjs

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
import 'zx/globals';
22

3-
const sha = process.argv[2] || process.env.GITHUB_SHA;
3+
const sha = process.argv[2] || process.env.GITHUB_SHA || 'HEAD';
44

5-
await $`git show ${sha}`;
5+
try {
6+
const modifiedPackages =
7+
await $`git show ${sha} --pretty="format:" --name-only -- packages/*/package.json`.nothrow();
68

7-
const modifiedPackages =
8-
await $`git show ${sha} --pretty="format:" --name-only -- packages/*/package.json`;
9+
const packageJsonPaths = modifiedPackages.stdout.trim().split('\n');
910

10-
const packageJsonPaths = modifiedPackages.stdout.trim().split('\n');
11+
const packageJsons = await Promise.all(
12+
packageJsonPaths.map((p) => fs.readJson(p))
13+
);
1114

12-
if (packageJsonPaths.length) {
13-
const packageJsons = await Promise.all(
14-
packageJsonPaths.map((p) => fs.readJson(p))
15-
);
16-
17-
for (const packageJson of packageJsons) {
18-
const tag = `${packageJson.name}@${packageJson.version}`;
19-
//await $`git tag ${tag}`;
20-
console.log({ tag })
21-
}
22-
} else {
23-
console.log('No tags need to be created');
15+
for (const packageJson of packageJsons) {
16+
const tag = `${packageJson.name}@${packageJson.version}`;
17+
//await $`git tag ${tag}`;
18+
console.log({ tag });
19+
}
20+
} catch {
21+
console.log('No tags need to be created');
2422
}

0 commit comments

Comments
 (0)