mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-26 10:43:09 +00:00
Working
This commit is contained in:
@@ -522,13 +522,13 @@ const sendToClientLocal = async (
|
|||||||
|
|
||||||
const messageString = JSON.stringify(messageWithVersion);
|
const messageString = JSON.stringify(messageWithVersion);
|
||||||
if (options.compress) {
|
if (options.compress) {
|
||||||
logger.debug(
|
// logger.debug(
|
||||||
`Message size before compression: ${messageString.length} bytes`
|
// `Message size before compression: ${messageString.length} bytes`
|
||||||
);
|
// );
|
||||||
const compressed = zlib.gzipSync(Buffer.from(messageString, "utf8"));
|
const compressed = zlib.gzipSync(Buffer.from(messageString, "utf8"));
|
||||||
logger.debug(
|
// logger.debug(
|
||||||
`Message size after compression: ${compressed.length} bytes`
|
// `Message size after compression: ${compressed.length} bytes`
|
||||||
);
|
// );
|
||||||
clients.forEach((client) => {
|
clients.forEach((client) => {
|
||||||
if (client.readyState === WebSocket.OPEN) {
|
if (client.readyState === WebSocket.OPEN) {
|
||||||
client.send(compressed);
|
client.send(compressed);
|
||||||
|
|||||||
@@ -58,7 +58,11 @@ async function getLatestReleaseInfo(): Promise<ReleaseInfo | null> {
|
|||||||
|
|
||||||
// Drop drafts, pre-releases, and anything with "rc" in the tag name.
|
// Drop drafts, pre-releases, and anything with "rc" in the tag name.
|
||||||
releases = releases.filter(
|
releases = releases.filter(
|
||||||
(r: any) => !r.draft && !r.prerelease && !r.tag_name.includes("rc")
|
(r: any) =>
|
||||||
|
!r.draft &&
|
||||||
|
!r.prerelease &&
|
||||||
|
!r.tag_name.includes("rc") &&
|
||||||
|
!r.tag_name.includes("v")
|
||||||
);
|
);
|
||||||
|
|
||||||
// Sort descending by semver to find the true latest stable release.
|
// Sort descending by semver to find the true latest stable release.
|
||||||
@@ -262,17 +266,12 @@ export async function getNewtVersion(
|
|||||||
|
|
||||||
const latestVersion = releaseInfo.version;
|
const latestVersion = releaseInfo.version;
|
||||||
|
|
||||||
// Normalise the tag (ensure leading 'v') for the download URL.
|
|
||||||
const tagForUrl = latestVersion.startsWith("v")
|
|
||||||
? latestVersion
|
|
||||||
: `v${latestVersion}`;
|
|
||||||
|
|
||||||
// Binary name follows the get-newt.sh convention: newt_<platform>[.exe]
|
// Binary name follows the get-newt.sh convention: newt_<platform>[.exe]
|
||||||
const binaryName = platform.includes("windows")
|
const binaryName = platform.includes("windows")
|
||||||
? `newt_${platform}.exe`
|
? `newt_${platform}.exe`
|
||||||
: `newt_${platform}`;
|
: `newt_${platform}`;
|
||||||
|
|
||||||
const downloadUrl = `https://github.com/fosrl/newt/releases/download/${tagForUrl}/${binaryName}`;
|
const downloadUrl = `https://github.com/fosrl/newt/releases/download/${latestVersion}/${binaryName}`;
|
||||||
|
|
||||||
// Look up the SHA256 digest for this specific binary from the GitHub
|
// Look up the SHA256 digest for this specific binary from the GitHub
|
||||||
// release asset metadata (the `digest` field, format "sha256:<hex>").
|
// release asset metadata (the `digest` field, format "sha256:<hex>").
|
||||||
|
|||||||
Reference in New Issue
Block a user