From fa326949b9b027f77319929fb18b3733e7b8c0ee Mon Sep 17 00:00:00 2001 From: desmondwong1215 Date: Thu, 5 Feb 2026 11:52:24 +0800 Subject: [PATCH 1/2] Fix regex pattern --- app/utils/github_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/github_cli.py b/app/utils/github_cli.py index 9b708f3..047e43d 100644 --- a/app/utils/github_cli.py +++ b/app/utils/github_cli.py @@ -29,8 +29,8 @@ def get_token_scopes() -> List[str]: match = regex.search(result.stdout) if match: scopes_str = match.group(1).strip() - scopes = re.findall(r"'([^']+)'", scopes_str) - scopes = [s.strip().lower() for s in scopes] + scopes = re.split(r"[,\s]+", scopes_str) + scopes = [s.strip().strip("'").lower() for s in scopes if s.strip()] return scopes return [] From 42db2590b230fef4c87c94cf60c282d518851527 Mon Sep 17 00:00:00 2001 From: desmondwong1215 Date: Thu, 5 Feb 2026 12:00:13 +0800 Subject: [PATCH 2/2] Fix NameError --- app/commands/download.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/commands/download.py b/app/commands/download.py index 603ef63..042ac1a 100644 --- a/app/commands/download.py +++ b/app/commands/download.py @@ -1,4 +1,5 @@ import os +import sys from datetime import datetime from pathlib import Path from typing import Dict, Optional @@ -76,7 +77,7 @@ def _download_exercise( os.chdir("..") rmtree(exercise) warn("Setup Git before downloading this exercise") - exit(1) + sys.exit(1) # Check if the exercise requires Github/Github CLI to operate, if so, error if not present if config.requires_github: @@ -91,7 +92,7 @@ def _download_exercise( os.chdir("..") rmtree(exercise) warn("Setup Github and Github CLI before downloading this exercise") - exit(1) + sys.exit(1) if len(config.base_files) > 0: info("Downloading base files...") @@ -162,7 +163,7 @@ def _download_hands_on(hands_on: str, formatted_hands_on: str) -> None: os.chdir("..") rmtree(hands_on) warn("Setup Git before downloading this hands-on") - exit(1) + sys.exit(1) if requires_github: try: @@ -176,7 +177,7 @@ def _download_hands_on(hands_on: str, formatted_hands_on: str) -> None: os.chdir("..") rmtree(hands_on) warn("Setup Github and Github CLI before downloading this hands-on") - exit(1) + sys.exit(1) verbose = get_verbose() with create_repo_smith(verbose, null_repo=True) as repo_smith: