Skip to content

add support for beta builds #12

@icy-comet

Description

@icy-comet

Today, I had to manually build a beta version to check if a bug existed in the latest version. However, this repo doesn't take into account beta builds. It would be great if beta releases were auto-built as well.

Attached below is a git patch to add support for beta builds based on changes I had to make today.

I didn't open a PR because I wanted to leave the final implementation to the maintainers. However, I think just including the patch file in the current branch would be easier than changing/editing files for this purpose. It would also keep the support optional and not affect the current GH actions.

The patch can be applied as usual with git am -k.

From c5b576db9a2deb2a072b1a50baa615c85bb3bf38 Mon Sep 17 00:00:00 2001
From: Aniket Teredesai <50461557+icy-comet@users.noreply.github.com>
Date: Sat, 2 Apr 2022 23:19:36 +0530
Subject: add support to build beta releases

---
 build.py  | 2 +-
 shared.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/build.py b/build.py
index 389c249..00b0172 100644
--- a/build.py
+++ b/build.py
@@ -46,7 +46,7 @@ def extract_archive(archive: str) -> str:
     """
 
     # given "less-561.zip", return "less-561
-    zip_dest = os.path.splitext(archive)[0]
+    zip_dest = os.path.splitext(archive)[0].replace("-beta", "")
 
     if os.path.exists(zip_dest):
         print("Removing preexisting directory: %s" % (zip_dest))
diff --git a/shared.py b/shared.py
index 6232600..91411c7 100644
--- a/shared.py
+++ b/shared.py
@@ -13,7 +13,7 @@ import time
 import urllib.request
 
 LESSURL = "http://greenwoodsoftware.com/less/download.html"
-version_url_re = re.compile(r"""Download <strong>RECOMMENDED</strong> version (.*?) """, re.M | re.S | re.I)
+version_url_re = re.compile(r"""Download <strong>BETA</strong> version (.*?) """, re.M | re.S | re.I)
 NEWFILE = "new.txt"
 
 
@@ -56,6 +56,6 @@ def get_latest_version_url(page: str) -> tuple:
         return (None, None)
 
     version = match[0]
-    archive = "less-%s.zip" % version
+    archive = "less-%s-beta.zip" % version
     url = LESSURL.replace("download.html", archive)
     return version, url
-- 
2.35.1.windows.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions