Skip to content

Commit 81baac7

Browse files
committed
[Docs Site] Track Linux releases with WARP script
1 parent 7bda519 commit 81baac7

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

bin/fetch-warp-releases.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import fs from "fs";
22
import YAML from "yaml";
33
import { marked } from "marked";
44

5-
const tracks = ["windows/ga", "windows/beta", "macos/ga", "macos/beta"];
5+
const tracks = [
6+
"windows/ga",
7+
"windows/beta",
8+
"macos/ga",
9+
"macos/beta",
10+
"noble-intel/ga",
11+
"noble-intel/beta",
12+
];
613

714
const linesToRemove = [
815
"For related Cloudflare for Teams documentation please see: https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp",
@@ -11,11 +18,23 @@ const linesToRemove = [
1118
"For Consumer documentation please see: https://developers.cloudflare.com/warp-client/",
1219
];
1320

14-
for (const track of tracks) {
21+
for (let track of tracks) {
1522
fetch(`https://downloads.cloudflareclient.com/v1/update/json/${track}`)
1623
.then((res) => res.json())
1724
.then((data) => {
25+
if (!data.items) {
26+
console.warn(
27+
`${track} has no releases: ${JSON.stringify(data, null, 2)}`,
28+
);
29+
30+
return;
31+
}
32+
1833
data.items.forEach((item) => {
34+
if (track.startsWith("noble-intel")) {
35+
track = track.replace("noble-intel", "linux");
36+
}
37+
1938
const path = `./src/content/warp-releases/${track}/${item.version}.yaml`;
2039

2140
if (fs.existsSync(path)) {

0 commit comments

Comments
 (0)