Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions app/commands/download.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
from datetime import datetime
from pathlib import Path
from typing import Dict, Optional
Expand Down Expand Up @@ -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:
Expand All @@ -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...")
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions app/utils/github_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

Expand Down