Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions bin/fetch-warp-releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import fs from "fs";
import YAML from "yaml";
import { marked } from "marked";

const tracks = ["windows/ga", "windows/beta", "macos/ga", "macos/beta"];
const tracks = [
"windows/ga",
"windows/beta",
"macos/ga",
"macos/beta",
"noble-intel/ga",
"noble-intel/beta",
];

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

for (const track of tracks) {
for (let track of tracks) {
fetch(`https://downloads.cloudflareclient.com/v1/update/json/${track}`)
.then((res) => res.json())
.then((data) => {
if (!data.items) {
console.warn(
`${track} has no releases: ${JSON.stringify(data, null, 2)}`,
);

return;
}

data.items.forEach((item) => {
if (track.startsWith("noble-intel")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fun.. surprised api doesn't just use linux

track = track.replace("noble-intel", "linux");
}

const path = `./src/content/warp-releases/${track}/${item.version}.yaml`;

if (fs.existsSync(path)) {
Expand Down
Loading