1#!/usr/bin/env node --redirect-warnings=/dev/null
2
3main();
4
5async function main() {
6 const apiKey = process.argv[2]
7 const zedVersion = process.argv[3]
8 const releaseNotes = process.argv[4]
9 const postBody = `
10 📣 Zed ${zedVersion} was just released!
11
12 Restart your Zed or head to the [releases page](https://zed.dev/releases/latest) to grab it.
13
14 ---
15
16 ${releaseNotes}
17 `
18
19 const title = `${zedVersion} Release Notes`
20
21 const options = {
22 method: "POST",
23 headers: {
24 "Api-Key": apiKey,
25 "Api-Username": "system"
26 },
27 body: new URLSearchParams({
28 title: title,
29 raw: postBody,
30 category: "8"
31 })
32 };
33
34 fetch("https://forum.zed.dev/posts.json", options)
35 .then(response => response.json())
36 .then(response => console.log(response))
37 .catch(err => console.error(err));
38}